Refactor @ApiResponses annotations (#2879)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -70,3 +70,6 @@ spring-shell.log
|
|||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
.gitmodules
|
.gitmodules
|
||||||
|
|
||||||
|
# AI
|
||||||
|
.claude
|
||||||
@@ -13,7 +13,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.auth.SpPermission;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ package org.eclipse.hawkbit.tenancy;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
class TenantAwareCacheManagerTest {
|
class TenantAwareCacheManagerTest {
|
||||||
|
|||||||
@@ -22,51 +22,52 @@ public final class DdiRestConstants {
|
|||||||
* The base URL mapping of the direct device integration rest resources.
|
* The base URL mapping of the direct device integration rest resources.
|
||||||
*/
|
*/
|
||||||
public static final String BASE_V1_REQUEST_MAPPING = "/{tenant}/controller/v1";
|
public static final String BASE_V1_REQUEST_MAPPING = "/{tenant}/controller/v1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deployment action resources.
|
* Deployment action resources.
|
||||||
*/
|
*/
|
||||||
public static final String DEPLOYMENT_BASE_ACTION = "deploymentBase";
|
public static final String DEPLOYMENT_BASE = "deploymentBase";
|
||||||
/**
|
/**
|
||||||
* Confirmation base resource.
|
* Confirmation base resource.
|
||||||
*/
|
*/
|
||||||
public static final String CONFIRMATION_BASE = "confirmationBase";
|
public static final String CONFIRMATION_BASE = "confirmationBase";
|
||||||
/**
|
|
||||||
* Activate auto-confirm
|
|
||||||
*/
|
|
||||||
public static final String AUTO_CONFIRM_ACTIVATE = "activateAutoConfirm";
|
|
||||||
/**
|
|
||||||
* Deactivate auto-confirm
|
|
||||||
*/
|
|
||||||
public static final String AUTO_CONFIRM_DEACTIVATE = "deactivateAutoConfirm";
|
|
||||||
/**
|
/**
|
||||||
* Installed action resources.
|
* Installed action resources.
|
||||||
*/
|
*/
|
||||||
public static final String INSTALLED_BASE_ACTION = "installedBase";
|
public static final String INSTALLED_BASE = "installedBase";
|
||||||
/**
|
|
||||||
* Cancel action resources.
|
|
||||||
*/
|
|
||||||
public static final String CANCEL_ACTION = "cancelAction";
|
|
||||||
/**
|
/**
|
||||||
* Feedback channel.
|
* Feedback channel.
|
||||||
*/
|
*/
|
||||||
public static final String FEEDBACK = "feedback";
|
public static final String FEEDBACK = "feedback";
|
||||||
|
/**
|
||||||
|
* Cancel action resources.
|
||||||
|
*/
|
||||||
|
public static final String CANCEL_ACTION = "cancelAction";
|
||||||
|
/**
|
||||||
|
* Config data action resources.
|
||||||
|
*/
|
||||||
|
public static final String CONFIG_DATA = "configData";
|
||||||
|
/**
|
||||||
|
* Activate auto-confirm
|
||||||
|
*/
|
||||||
|
public static final String ACTIVATE_AUTO_CONFIRM = "activateAutoConfirm";
|
||||||
|
/**
|
||||||
|
* Deactivate auto-confirm
|
||||||
|
*/
|
||||||
|
public static final String DEACTIVATE_AUTO_CONFIRM = "deactivateAutoConfirm";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Media type for CBOR content.
|
||||||
|
*/
|
||||||
|
public static final String MEDIA_TYPE_APPLICATION_CBOR = "application/cbor";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File suffix for MDH hash download (see Linux md5sum).
|
* File suffix for MDH hash download (see Linux md5sum).
|
||||||
*/
|
*/
|
||||||
public static final String ARTIFACT_MD5_DOWNLOAD_SUFFIX = ".MD5SUM";
|
public static final String ARTIFACT_MD5_DOWNLOAD_SUFFIX = ".MD5SUM";
|
||||||
/**
|
|
||||||
* Config data action resources.
|
|
||||||
*/
|
|
||||||
public static final String CONFIG_DATA_ACTION = "configData";
|
|
||||||
/**
|
/**
|
||||||
* Default value specifying that no action history to be sent as part of response to deploymentBase
|
* Default value specifying that no action history to be sent as part of response to deploymentBase
|
||||||
* {@link DdiRootControllerRestApi#getControllerDeploymentBaseAction}.
|
* {@link DdiRootControllerRestApi#getControllerDeploymentBaseAction}, {@link DdiRootControllerRestApi#getConfirmationBaseAction}.
|
||||||
* {@link DdiRootControllerRestApi#getConfirmationBaseAction}.
|
|
||||||
*/
|
*/
|
||||||
public static final String NO_ACTION_HISTORY = "0";
|
public static final String NO_ACTION_HISTORY = "0";
|
||||||
/**
|
|
||||||
* Media type for CBOR content. Unfortunately, there is no other constant we
|
|
||||||
* can reuse - even the Jackson data converter simply hardcodes this.
|
|
||||||
*/
|
|
||||||
public static final String MEDIA_TYPE_CBOR = "application/cbor";
|
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.rest.api;
|
package org.eclipse.hawkbit.ddi.rest.api;
|
||||||
|
|
||||||
|
import static org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants.BASE_V1_REQUEST_MAPPING;
|
||||||
|
import static org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants.DEPLOYMENT_BASE;
|
||||||
|
import static org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants.FEEDBACK;
|
||||||
|
import static org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR;
|
||||||
|
import static org.springframework.hateoas.MediaTypes.HAL_JSON_VALUE;
|
||||||
|
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -35,8 +42,10 @@ import org.eclipse.hawkbit.ddi.json.model.DdiConfirmationBaseAction;
|
|||||||
import org.eclipse.hawkbit.ddi.json.model.DdiConfirmationFeedback;
|
import org.eclipse.hawkbit.ddi.json.model.DdiConfirmationFeedback;
|
||||||
import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
|
import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
|
||||||
import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase;
|
import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateResponses;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -64,25 +73,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all artifacts of a given software module and target",
|
@Operation(summary = "Return all artifacts of a given software module and target",
|
||||||
description = "Returns all artifacts that are assigned to the software module")
|
description = "Returns all artifacts that are assigned to the software module")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/softwaremodules/{softwareModuleId}/artifacts",
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/softwaremodules/{softwareModuleId}/artifacts",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<List<DdiArtifact>> getSoftwareModulesArtifacts(
|
ResponseEntity<List<DdiArtifact>> getSoftwareModulesArtifacts(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") String controllerId,
|
@PathVariable("controllerId") String controllerId,
|
||||||
@@ -103,25 +96,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
|
|
||||||
Note: deployments have to be confirmed in order to move on to the next action. Cancellations have to be
|
Note: deployments have to be confirmed in order to move on to the next action. Cancellations have to be
|
||||||
confirmed or rejected.""")
|
confirmed or rejected.""")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}",
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to " +
|
|
||||||
"be changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<DdiControllerBase> getControllerBase(
|
ResponseEntity<DdiControllerBase> getControllerBase(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") String controllerId);
|
@PathVariable("controllerId") String controllerId);
|
||||||
@@ -139,26 +116,8 @@ public interface DdiRootControllerRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Artifact download", description = "Handles GET DdiArtifact download request. This could be " +
|
@Operation(summary = "Artifact download", description = "Handles GET DdiArtifact download request. This could be " +
|
||||||
"full or partial (as specified by RFC7233 (Range Requests)) download request.")
|
"full or partial (as specified by RFC7233 (Range Requests)) download request.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING +
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be" +
|
|
||||||
" changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target or Module not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts" +
|
|
||||||
" and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING +
|
|
||||||
"/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{fileName}")
|
"/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{fileName}")
|
||||||
ResponseEntity<InputStream> downloadArtifact(
|
ResponseEntity<InputStream> downloadArtifact(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@@ -177,26 +136,8 @@ public interface DdiRootControllerRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "MD5 checksum download",
|
@Operation(summary = "MD5 checksum download",
|
||||||
description = "Handles GET {@link DdiArtifact} MD5 checksum file download request.")
|
description = "Handles GET {@link DdiArtifact} MD5 checksum file download request.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" +
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target or Module not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" +
|
|
||||||
DdiRestConstants.ARTIFACT_MD5_DOWNLOAD_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE)
|
DdiRestConstants.ARTIFACT_MD5_DOWNLOAD_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||||
ResponseEntity<Void> downloadArtifactMd5(
|
ResponseEntity<Void> downloadArtifactMd5(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@@ -227,39 +168,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
Host, port and path and not guaranteed to be similar to the provided examples below but will be defined at
|
Host, port and path and not guaranteed to be similar to the provided examples below but will be defined at
|
||||||
runtime.
|
runtime.
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = """
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DEPLOYMENT_BASE + "/{actionId}",
|
||||||
Successfully retrieved
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
|
|
||||||
In case a device provides state information on the feedback channel and won’t store it locally,
|
|
||||||
a query for, e.q, the last 10 messages, could be used which will include the previously provided by the
|
|
||||||
device, feedback.
|
|
||||||
|
|
||||||
In addition to the straight forward approach to inform the device to download and install the software
|
|
||||||
in one transaction hawkBit supports the separation of download and installation into separate steps.
|
|
||||||
|
|
||||||
This feature is called Maintenance Window where the device is informed to download the software first
|
|
||||||
and then when it enters a defined (maintenance) window the installation triggers follows as usual.
|
|
||||||
"""),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json",
|
|
||||||
schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<DdiDeploymentBase> getControllerDeploymentBaseAction(
|
ResponseEntity<DdiDeploymentBase> getControllerDeploymentBaseAction(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId,
|
@PathVariable("controllerId") @NotEmpty String controllerId,
|
||||||
@@ -285,35 +196,13 @@ public interface DdiRootControllerRestApi {
|
|||||||
However, the action will be kept open until the controller on the device reports a finished (either successful
|
However, the action will be kept open until the controller on the device reports a finished (either successful
|
||||||
or error).
|
or error).
|
||||||
""")
|
""")
|
||||||
|
@PostUpdateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION +
|
@PostMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DEPLOYMENT_BASE +
|
||||||
"/{actionId}/" + DdiRestConstants.FEEDBACK, consumes = { MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
"/{actionId}/" + FEEDBACK, consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
ResponseEntity<Void> postDeploymentBaseActionFeedback(
|
ResponseEntity<Void> postDeploymentBaseActionFeedback(
|
||||||
@Valid @RequestBody DdiActionFeedback feedback,
|
@Valid @RequestBody DdiActionFeedback feedback,
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@@ -332,31 +221,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
The usual behaviour is that when a new device registers at the server it is requested to provide the meta
|
The usual behaviour is that when a new device registers at the server it is requested to provide the meta
|
||||||
information that will allow the server to identify the device on a hardware level (e.g. hardware revision,
|
information that will allow the server to identify the device on a hardware level (e.g. hardware revision,
|
||||||
mac address, serial number etc.).""")
|
mac address, serial number etc.).""")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@PutMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIG_DATA,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIG_DATA_ACTION,
|
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<Void> putConfigData(
|
ResponseEntity<Void> putConfigData(
|
||||||
@Valid @RequestBody DdiConfigData configData,
|
@Valid @RequestBody DdiConfigData configData,
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@@ -373,25 +240,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
@Operation(summary = "Cancel an action", description = """
|
@Operation(summary = "Cancel an action", description = """
|
||||||
The Hawkbit server might cancel an operation, e.g. an unfinished update has a successor. It is up to the
|
The Hawkbit server might cancel an operation, e.g. an unfinished update has a successor. It is up to the
|
||||||
provisioning target to decide to accept the cancellation or reject it.""")
|
provisioning target to decide to accept the cancellation or reject it.""")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}",
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<DdiCancel> getControllerCancelAction(
|
ResponseEntity<DdiCancel> getControllerCancelAction(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId,
|
@PathVariable("controllerId") @NotEmpty String controllerId,
|
||||||
@@ -410,31 +261,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
It is up to the device how much intermediate feedback is provided. However, the action will be kept open
|
It is up to the device how much intermediate feedback is provided. However, the action will be kept open
|
||||||
until the controller on the device reports a finished (either successful or error) or rejects the action,
|
until the controller on the device reports a finished (either successful or error) or rejects the action,
|
||||||
e.g. the canceled actions have been started already.""")
|
e.g. the canceled actions have been started already.""")
|
||||||
@ApiResponses(value = {
|
@PostUpdateResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@PostMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}/" +
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
FEEDBACK, consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}/" +
|
|
||||||
DdiRestConstants.FEEDBACK, consumes = { MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<Void> postCancelActionFeedback(
|
ResponseEntity<Void> postCancelActionFeedback(
|
||||||
@Valid @RequestBody DdiActionFeedback feedback,
|
@Valid @RequestBody DdiActionFeedback feedback,
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@@ -465,30 +294,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
Host, port and path are not guaranteed to be similar to the provided examples below but will be defined at
|
Host, port and path are not guaranteed to be similar to the provided examples below but will be defined at
|
||||||
runtime.
|
runtime.
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = """
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.INSTALLED_BASE + "/{actionId}",
|
||||||
The response body includes the detailed operation for the already finished action in the same format as
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
for the deploymentBase operation.
|
|
||||||
|
|
||||||
In this case the (optional) query for the last 10 messages, previously provided by the device, are included.
|
|
||||||
"""),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.INSTALLED_BASE_ACTION + "/{actionId}",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<DdiDeploymentBase> getControllerInstalledAction(
|
ResponseEntity<DdiDeploymentBase> getControllerInstalledAction(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId,
|
@PathVariable("controllerId") @NotEmpty String controllerId,
|
||||||
@@ -509,28 +317,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
like the initiator, remark and date of activation (as unix timestamp) will be provided.
|
like the initiator, remark and date of activation (as unix timestamp) will be provided.
|
||||||
Reference links to switch the auto-confirmation state are exposed as well.
|
Reference links to switch the auto-confirmation state are exposed as well.
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = """
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE,
|
||||||
The response body in case auto-confirmation is active is richer - it contains additional information
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
such as initiator, remark and when the auto-confirmation had been activated.
|
|
||||||
"""),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE,
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<DdiConfirmationBase> getConfirmationBase(
|
ResponseEntity<DdiConfirmationBase> getConfirmationBase(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId);
|
@PathVariable("controllerId") @NotEmpty String controllerId);
|
||||||
@@ -560,28 +349,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
Host, port and path are not guaranteed to be similar to the provided examples below but will be defined at
|
Host, port and path are not guaranteed to be similar to the provided examples below but will be defined at
|
||||||
runtime.
|
runtime.
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "The response body includes the detailed information about " +
|
@GetMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/{actionId}",
|
||||||
"the action awaiting confirmation in the same format as for the deploymentBase operation."),
|
produces = { HAL_JSON_VALUE, APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/{actionId}",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<DdiConfirmationBaseAction> getConfirmationBaseAction(
|
ResponseEntity<DdiConfirmationBaseAction> getConfirmationBaseAction(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId,
|
@PathVariable("controllerId") @NotEmpty String controllerId,
|
||||||
@@ -603,36 +373,14 @@ public interface DdiRootControllerRestApi {
|
|||||||
action will be transferred into the RUNNING state in case the device is confirming it. Afterwards it will be
|
action will be transferred into the RUNNING state in case the device is confirming it. Afterwards it will be
|
||||||
exposed by the deploymentBase.
|
exposed by the deploymentBase.
|
||||||
""")
|
""")
|
||||||
|
@PostUpdateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target or Action not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/{actionId}/" +
|
@PostMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/{actionId}/" +
|
||||||
DdiRestConstants.FEEDBACK,
|
FEEDBACK,
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
ResponseEntity<Void> postConfirmationActionFeedback(
|
ResponseEntity<Void> postConfirmationActionFeedback(
|
||||||
@Valid @RequestBody DdiConfirmationFeedback feedback,
|
@Valid @RequestBody DdiConfirmationFeedback feedback,
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@@ -654,33 +402,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
future actions will automatically be confirmed by mentioning the initiator as triggered person. Actions will
|
future actions will automatically be confirmed by mentioning the initiator as triggered person. Actions will
|
||||||
be automatically confirmed, as long as auto-confirmation is active.
|
be automatically confirmed, as long as auto-confirmation is active.
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@PostUpdateResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@PostMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/" +
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
DdiRestConstants.ACTIVATE_AUTO_CONFIRM, consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/" +
|
|
||||||
DdiRestConstants.AUTO_CONFIRM_ACTIVATE, consumes = { MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
|
||||||
ResponseEntity<Void> activateAutoConfirmation(
|
ResponseEntity<Void> activateAutoConfirmation(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId,
|
@PathVariable("controllerId") @NotEmpty String controllerId,
|
||||||
@@ -697,33 +421,9 @@ public interface DdiRootControllerRestApi {
|
|||||||
The device can use this resource to deactivate auto-confirmation. All active actions will remain unchanged
|
The device can use this resource to deactivate auto-confirmation. All active actions will remain unchanged
|
||||||
while all future actions need to be confirmed, before processing with the deployment.
|
while all future actions need to be confirmed, before processing with the deployment.
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@PostUpdateResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@PostMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/" +
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
DdiRestConstants.DEACTIVATE_AUTO_CONFIRM)
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.CONFIRMATION_BASE + "/" +
|
|
||||||
DdiRestConstants.AUTO_CONFIRM_DEACTIVATE)
|
|
||||||
ResponseEntity<Void> deactivateAutoConfirmation(
|
ResponseEntity<Void> deactivateAutoConfirmation(
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
@PathVariable("controllerId") @NotEmpty String controllerId);
|
@PathVariable("controllerId") @NotEmpty String controllerId);
|
||||||
@@ -740,35 +440,13 @@ public interface DdiRootControllerRestApi {
|
|||||||
Allow to set current running version.
|
Allow to set current running version.
|
||||||
This method is EXPERIMENTAL and may change in future releases.
|
This method is EXPERIMENTAL and may change in future releases.
|
||||||
""")
|
""")
|
||||||
|
@PutResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) " +
|
|
||||||
"or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target or Distribution not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another user in another " +
|
|
||||||
"request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not supported by the server " +
|
|
||||||
"for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts and the client has " +
|
|
||||||
"to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PutMapping(value = DdiRestConstants.BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.INSTALLED_BASE_ACTION,
|
@PutMapping(value = BASE_V1_REQUEST_MAPPING + "/{controllerId}/" + DdiRestConstants.INSTALLED_BASE,
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR })
|
consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
ResponseEntity<Void> setAssignedOfflineVersion(
|
ResponseEntity<Void> setAssignedOfflineVersion(
|
||||||
@Valid @RequestBody DdiAssignedVersion ddiAssignedVersion,
|
@Valid @RequestBody DdiAssignedVersion ddiAssignedVersion,
|
||||||
@PathVariable("tenant") String tenant,
|
@PathVariable("tenant") String tenant,
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ public final class DataConversionHelper {
|
|||||||
confirmationBase.add(WebMvcLinkBuilder
|
confirmationBase.add(WebMvcLinkBuilder
|
||||||
.linkTo(WebMvcLinkBuilder.methodOn(DdiRootController.class, AccessContext.tenant())
|
.linkTo(WebMvcLinkBuilder.methodOn(DdiRootController.class, AccessContext.tenant())
|
||||||
.deactivateAutoConfirmation(AccessContext.tenant(), controllerId))
|
.deactivateAutoConfirmation(AccessContext.tenant(), controllerId))
|
||||||
.withRel(DdiRestConstants.AUTO_CONFIRM_DEACTIVATE).expand());
|
.withRel(DdiRestConstants.DEACTIVATE_AUTO_CONFIRM).expand());
|
||||||
} else {
|
} else {
|
||||||
confirmationBase.add(WebMvcLinkBuilder
|
confirmationBase.add(WebMvcLinkBuilder
|
||||||
.linkTo(WebMvcLinkBuilder.methodOn(DdiRootController.class, AccessContext.tenant())
|
.linkTo(WebMvcLinkBuilder.methodOn(DdiRootController.class, AccessContext.tenant())
|
||||||
.activateAutoConfirmation(AccessContext.tenant(), controllerId, null))
|
.activateAutoConfirmation(AccessContext.tenant(), controllerId, null))
|
||||||
.withRel(DdiRestConstants.AUTO_CONFIRM_ACTIVATE).expand());
|
.withRel(DdiRestConstants.ACTIVATE_AUTO_CONFIRM).expand());
|
||||||
}
|
}
|
||||||
if (activeAction != null && activeAction.isWaitingConfirmation()) {
|
if (activeAction != null && activeAction.isWaitingConfirmation()) {
|
||||||
confirmationBase.add(WebMvcLinkBuilder
|
confirmationBase.add(WebMvcLinkBuilder
|
||||||
@@ -101,7 +101,7 @@ public final class DataConversionHelper {
|
|||||||
.getControllerDeploymentBaseAction(
|
.getControllerDeploymentBaseAction(
|
||||||
AccessContext.tenant(), target.getControllerId(),
|
AccessContext.tenant(), target.getControllerId(),
|
||||||
activeAction.getId(), calculateEtag(activeAction), null))
|
activeAction.getId(), calculateEtag(activeAction), null))
|
||||||
.withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION).expand());
|
.withRel(DdiRestConstants.DEPLOYMENT_BASE).expand());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ public final class DataConversionHelper {
|
|||||||
.linkTo(WebMvcLinkBuilder.methodOn(DdiRootController.class, AccessContext.tenant())
|
.linkTo(WebMvcLinkBuilder.methodOn(DdiRootController.class, AccessContext.tenant())
|
||||||
.getControllerInstalledAction(AccessContext.tenant(),
|
.getControllerInstalledAction(AccessContext.tenant(),
|
||||||
target.getControllerId(), installedAction.getId(), null))
|
target.getControllerId(), installedAction.getId(), null))
|
||||||
.withRel(DdiRestConstants.INSTALLED_BASE_ACTION).expand());
|
.withRel(DdiRestConstants.INSTALLED_BASE).expand());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.isRequestControllerAttributes()) {
|
if (target.isRequestControllerAttributes()) {
|
||||||
@@ -120,7 +120,7 @@ public final class DataConversionHelper {
|
|||||||
.methodOn(DdiRootController.class, AccessContext.tenant())
|
.methodOn(DdiRootController.class, AccessContext.tenant())
|
||||||
// doesn't really call the putConfigData with null, just create the link
|
// doesn't really call the putConfigData with null, just create the link
|
||||||
.putConfigData(null, AccessContext.tenant(), target.getControllerId()))
|
.putConfigData(null, AccessContext.tenant(), target.getControllerId()))
|
||||||
.withRel(DdiRestConstants.CONFIG_DATA_ACTION).expand());
|
.withRel(DdiRestConstants.CONFIG_DATA).expand());
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest {
|
|||||||
final byte[] result = mvc
|
final byte[] result = mvc
|
||||||
.perform(get("/{tenant}/controller/v1/" + TestdataFactory.DEFAULT_CONTROLLER_ID + "/cancelAction/"
|
.perform(get("/{tenant}/controller/v1/" + TestdataFactory.DEFAULT_CONTROLLER_ID + "/cancelAction/"
|
||||||
+ cancelAction.getId(), AccessContext.tenant())
|
+ cancelAction.getId(), AccessContext.tenant())
|
||||||
.accept(DdiRestConstants.MEDIA_TYPE_CBOR))
|
.accept(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(content().contentType(DdiRestConstants.MEDIA_TYPE_CBOR))
|
.andExpect(content().contentType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR))
|
||||||
.andReturn().getResponse()
|
.andReturn().getResponse()
|
||||||
.getContentAsByteArray();
|
.getContentAsByteArray();
|
||||||
assertThat(JsonPathUtils.<String> evaluate(cborToJson(result), "$.id"))
|
assertThat(JsonPathUtils.<String> evaluate(cborToJson(result), "$.id"))
|
||||||
@@ -83,7 +83,7 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest {
|
|||||||
mvc.perform(post("/{tenant}/controller/v1/" + TestdataFactory.DEFAULT_CONTROLLER_ID + "/cancelAction/"
|
mvc.perform(post("/{tenant}/controller/v1/" + TestdataFactory.DEFAULT_CONTROLLER_ID + "/cancelAction/"
|
||||||
+ cancelAction.getId() + "/feedback", AccessContext.tenant())
|
+ cancelAction.getId() + "/feedback", AccessContext.tenant())
|
||||||
.content(jsonToCbor(getJsonProceedingCancelActionFeedback()))
|
.content(jsonToCbor(getJsonProceedingCancelActionFeedback()))
|
||||||
.contentType(DdiRestConstants.MEDIA_TYPE_CBOR).accept(DdiRestConstants.MEDIA_TYPE_CBOR))
|
.contentType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR).accept(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest {
|
|||||||
|
|
||||||
mvc.perform(put(TARGET1_CONFIG_DATA_PATH, AccessContext.tenant())
|
mvc.perform(put(TARGET1_CONFIG_DATA_PATH, AccessContext.tenant())
|
||||||
.content(jsonToCbor(JsonBuilder.configData(attributes).toString()))
|
.content(jsonToCbor(JsonBuilder.configData(attributes).toString()))
|
||||||
.contentType(DdiRestConstants.MEDIA_TYPE_CBOR))
|
.contentType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
assertThat(targetManagement.getControllerAttributes(TARGET1_ID)).isEqualTo(attributes);
|
assertThat(targetManagement.getControllerAttributes(TARGET1_ID)).isEqualTo(attributes);
|
||||||
|
|||||||
@@ -150,11 +150,11 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest {
|
|||||||
final Action action = deploymentManagement.findActiveActionsByTarget(target.getControllerId(), PAGE).getContent().get(0);
|
final Action action = deploymentManagement.findActiveActionsByTarget(target.getControllerId(), PAGE).getContent().get(0);
|
||||||
|
|
||||||
// get confirmation base
|
// get confirmation base
|
||||||
performGet(CONFIRMATION_BASE_ACTION, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR),
|
performGet(CONFIRMATION_BASE_ACTION, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR),
|
||||||
status().isOk(), AccessContext.tenant(), target.getControllerId(), action.getId().toString());
|
status().isOk(), AccessContext.tenant(), target.getControllerId(), action.getId().toString());
|
||||||
|
|
||||||
// get artifacts
|
// get artifacts
|
||||||
performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR),
|
performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR),
|
||||||
status().isOk(), AccessContext.tenant(), target.getControllerId(),
|
status().isOk(), AccessContext.tenant(), target.getControllerId(),
|
||||||
String.valueOf(softwareModuleId));
|
String.valueOf(softwareModuleId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,17 +96,17 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest {
|
|||||||
final Action action = deploymentManagement.findActiveActionsByTarget(target.getControllerId(), PAGE).getContent().get(0);
|
final Action action = deploymentManagement.findActiveActionsByTarget(target.getControllerId(), PAGE).getContent().get(0);
|
||||||
|
|
||||||
// get deployment base
|
// get deployment base
|
||||||
performGet(DEPLOYMENT_BASE, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR), status().isOk(),
|
performGet(DEPLOYMENT_BASE, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR), status().isOk(),
|
||||||
AccessContext.tenant(), target.getControllerId(), action.getId().toString());
|
AccessContext.tenant(), target.getControllerId(), action.getId().toString());
|
||||||
|
|
||||||
// get artifacts
|
// get artifacts
|
||||||
performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR),
|
performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR),
|
||||||
status().isOk(), AccessContext.tenant(), target.getControllerId(),
|
status().isOk(), AccessContext.tenant(), target.getControllerId(),
|
||||||
String.valueOf(softwareModuleId));
|
String.valueOf(softwareModuleId));
|
||||||
|
|
||||||
final byte[] feedback = jsonToCbor(getJsonProceedingDeploymentActionFeedback());
|
final byte[] feedback = jsonToCbor(getJsonProceedingDeploymentActionFeedback());
|
||||||
postDeploymentFeedback(
|
postDeploymentFeedback(
|
||||||
MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR), target.getControllerId(), action.getId(), feedback,
|
MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR), target.getControllerId(), action.getId(), feedback,
|
||||||
status().isOk());
|
status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,11 +90,11 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest {
|
|||||||
postDeploymentFeedback(target.getControllerId(), actionId, getJsonClosedDeploymentActionFeedback(), status().isOk());
|
postDeploymentFeedback(target.getControllerId(), actionId, getJsonClosedDeploymentActionFeedback(), status().isOk());
|
||||||
|
|
||||||
// get installed base
|
// get installed base
|
||||||
performGet(INSTALLED_BASE, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR), status().isOk(),
|
performGet(INSTALLED_BASE, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR), status().isOk(),
|
||||||
AccessContext.tenant(), target.getControllerId(), actionId.toString());
|
AccessContext.tenant(), target.getControllerId(), actionId.toString());
|
||||||
|
|
||||||
// get artifacts
|
// get artifacts
|
||||||
performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_CBOR),
|
performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.parseMediaType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR),
|
||||||
status().isOk(), AccessContext.tenant(), target.getControllerId(),
|
status().isOk(), AccessContext.tenant(), target.getControllerId(),
|
||||||
String.valueOf(softwareModuleId));
|
String.valueOf(softwareModuleId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
void rootPollResourceCbor() throws Exception {
|
void rootPollResourceCbor() throws Exception {
|
||||||
mvc.perform(get(CONTROLLER_BASE, AccessContext.tenant(), 4711).accept(DdiRestConstants.MEDIA_TYPE_CBOR))
|
mvc.perform(get(CONTROLLER_BASE, AccessContext.tenant(), 4711).accept(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(content().contentType(DdiRestConstants.MEDIA_TYPE_CBOR))
|
.andExpect(content().contentType(DdiRestConstants.MEDIA_TYPE_APPLICATION_CBOR))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,5 +25,4 @@ public class MgmtInvalidateDistributionSetRequestBody {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Schema(description = "Type of cancelation for actions referring to the given distribution set")
|
@Schema(description = "Type of cancelation for actions referring to the given distribution set")
|
||||||
private MgmtCancelationType actionCancelationType;
|
private MgmtCancelationType actionCancelationType;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class MgmtTarget extends MgmtNamedEntity {
|
|||||||
|
|
||||||
@Schema(description = "Pre-Shared key that allows targets to authenticate at Direct Device Integration " +
|
@Schema(description = "Pre-Shared key that allows targets to authenticate at Direct Device Integration " +
|
||||||
"API if enabled in the tenant settings", example = "38e6a19932b014040ba061795186514e")
|
"API if enabled in the tenant settings", example = "38e6a19932b014040ba061795186514e")
|
||||||
@ToString.Exclude
|
@ToString.Exclude // note - it is included only if the received has the needed permissions
|
||||||
private String securityToken;
|
private String securityToken;
|
||||||
|
|
||||||
@Schema(description = "Request re-transmission of target attributes", example = "true")
|
@Schema(description = "Request re-transmission of target attributes", example = "true")
|
||||||
|
|||||||
@@ -10,21 +10,20 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.ACTION_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.ACTION_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction;
|
import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -56,30 +55,15 @@ public interface MgmtActionRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all actions", description = "Handles the GET request of retrieving all actions.")
|
@Operation(summary = "Return all actions", description = "Handles the GET request of retrieving all actions.")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING, 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(
|
ResponseEntity<PagedList<MgmtAction>> getActions(
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -112,20 +96,7 @@ public interface MgmtActionRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return action by id",
|
@Operation(summary = "Return action by id",
|
||||||
description = "Handles the GET request of retrieving a single action by actionId.")
|
description = "Handles the GET request of retrieving a single action by actionId.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts" +
|
|
||||||
" and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}",
|
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtAction> getAction(@PathVariable("actionId") Long actionId);
|
ResponseEntity<MgmtAction> getAction(@PathVariable("actionId") Long actionId);
|
||||||
@@ -137,15 +108,7 @@ public interface MgmtActionRestApi {
|
|||||||
* @return status OK if delete as successful.
|
* @return status OK if delete as successful.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete a single action by id", description = "Handles the DELETE request for single action within Bosch IoT Rollouts. Required Permission: DELETE_REPOSITORY")
|
@Operation(summary = "Delete a single action by id", description = "Handles the DELETE request for single action within Bosch IoT Rollouts. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Action not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts and the client has to wait another second.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))) })
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}")
|
@DeleteMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}")
|
||||||
ResponseEntity<Void> deleteAction(@PathVariable("actionId") Long actionId);
|
ResponseEntity<Void> deleteAction(@PathVariable("actionId") Long actionId);
|
||||||
|
|
||||||
@@ -157,21 +120,15 @@ public interface MgmtActionRestApi {
|
|||||||
* @return status OK if delete as successful.
|
* @return status OK if delete as successful.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete multiple actions by list OR rsql filter", description = "Handles the DELETE request for multiple actions within Bosch IoT Rollouts. Either action id list OR rsql filter SHOULD be provided. Required Permission: DELETE_REPOSITORY")
|
@Operation(summary = "Delete multiple actions by list OR rsql filter", description = "Handles the DELETE request for multiple actions within Bosch IoT Rollouts. Either action id list OR rsql filter SHOULD be provided. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts and the client has to wait another second.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))) })
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING)
|
@DeleteMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING)
|
||||||
ResponseEntity<Void> deleteActions(
|
ResponseEntity<Void> deleteActions(
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false, defaultValue = "")
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false, defaultValue = "")
|
||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam,
|
String rsqlParam,
|
||||||
@Schema(description = "List of action ids to be deleted", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "[253, 255]")
|
@Schema(description = "List of action ids to be deleted", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "[253, 255]")
|
||||||
@RequestBody(required = false) List<Long> actionIds);
|
@RequestBody(required = false)
|
||||||
|
List<Long> actionIds);
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.BASIC_AUTH_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.BASIC_AUTH_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
@@ -36,6 +37,7 @@ public interface MgmtBasicAuthRestApi {
|
|||||||
*
|
*
|
||||||
* @return the userinfo with status OK.
|
* @return the userinfo with status OK.
|
||||||
*/
|
*/
|
||||||
|
@GetResponses
|
||||||
@GetMapping(value = MgmtRestConstants.AUTH_V1_REQUEST_MAPPING, 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();
|
ResponseEntity<MgmtUserInfo> validateBasicAuth();
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,12 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DISTRIBUTION_SET_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DISTRIBUTION_SET_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutNoContentResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -37,8 +43,9 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssignment;
|
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssignment;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtTargetFilterQuery;
|
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtTargetFilterQuery;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateNoContentResponses;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -72,23 +79,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all Distribution Sets", description = "Handles the GET request of retrieving all " +
|
@Operation(summary = "Return all Distribution Sets", description = "Handles the GET request of retrieving all " +
|
||||||
"distribution sets. Required permission: READ_REPOSITORY")
|
"distribution sets. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further " +
|
|
||||||
"attempts and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
|
ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
|
||||||
@@ -96,7 +87,8 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -122,25 +114,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single Distribution Set", description = "Handles the GET request of retrieving a " +
|
@Operation(summary = "Return single Distribution Set", description = "Handles the GET request of retrieving a " +
|
||||||
"single distribution set. Required permission: READ_REPOSITORY")
|
"single distribution set. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSet> getDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
|
ResponseEntity<MgmtDistributionSet> getDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
|
||||||
@@ -155,29 +129,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Operation(summary = "Creates new Distribution Sets", description = "Handles the POST request of creating new " +
|
@Operation(summary = "Creates new Distribution Sets", description = "Handles the POST request of creating new " +
|
||||||
"distribution sets within Hawkbit. The request body must always be a list of sets. " +
|
"distribution sets within Hawkbit. The request body must always be a list of sets. " +
|
||||||
"Required permission: CREATE_REPOSITORY")
|
"Required permission: CREATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -191,25 +143,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete Distribution Set by Id", description = "Handles the DELETE request for a single " +
|
@Operation(summary = "Delete Distribution Set by Id", description = "Handles the DELETE request for a single " +
|
||||||
"Distribution Set. Required permission: DELETE_REPOSITORY")
|
"Distribution Set. Required permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}")
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}")
|
||||||
ResponseEntity<Void> deleteDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
|
ResponseEntity<Void> deleteDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
|
||||||
|
|
||||||
@@ -222,31 +156,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update Distribution Set", description = "Handles the UPDATE request for a single " +
|
@Operation(summary = "Update Distribution Set", description = "Handles the UPDATE request for a single " +
|
||||||
"Distribution Set. Required permission: UPDATE_REPOSITORY")
|
"Distribution Set. Required permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further " +
|
|
||||||
"attempts and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}",
|
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
produces = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
||||||
@@ -268,25 +178,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Operation(summary = "Return assigned targets to a specific distribution set", description = "Handles the GET " +
|
@Operation(summary = "Return assigned targets to a specific distribution set", description = "Handles the GET " +
|
||||||
"request for retrieving assigned targets of a single distribution set. " +
|
"request for retrieving assigned targets of a single distribution set. " +
|
||||||
"Required permissions: READ_REPOSITORY and READ_TARGET")
|
"Required permissions: READ_REPOSITORY and READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedTargets",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedTargets",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
|
||||||
@@ -295,7 +187,8 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -327,25 +220,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Operation(summary = "Return installed targets to a specific distribution set", description = "Handles the GET " +
|
@Operation(summary = "Return installed targets to a specific distribution set", description = "Handles the GET " +
|
||||||
"request for retrieving installed targets of a single distribution set. " +
|
"request for retrieving installed targets of a single distribution set. " +
|
||||||
"Required permissions: READ_REPOSITORY and READ_TARGET")
|
"Required permissions: READ_REPOSITORY and READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/installedTargets",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/installedTargets",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getInstalledTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getInstalledTargets(
|
||||||
@@ -354,7 +229,8 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -386,25 +262,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Operation(summary = "Return target filter queries that have the given distribution set as auto assign DS",
|
@Operation(summary = "Return target filter queries that have the given distribution set as auto assign DS",
|
||||||
description = "Handles the GET request for retrieving assigned target filter queries of a single " +
|
description = "Handles the GET request for retrieving assigned target filter queries of a single " +
|
||||||
"distribution set. Required permissions: READ_REPOSITORY and READ_TARGET")
|
"distribution set. Required permissions: READ_REPOSITORY and READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/autoAssignTargetFilters",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/autoAssignTargetFilters",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTargetFilterQuery>> getAutoAssignTargetFilterQueries(
|
ResponseEntity<PagedList<MgmtTargetFilterQuery>> getAutoAssignTargetFilterQueries(
|
||||||
@@ -413,7 +271,8 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -444,29 +303,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
"request for assigning multiple targets to a distribution set.The request body must always be a list of " +
|
"request for assigning multiple targets to a distribution set.The request body must always be a list of " +
|
||||||
"target IDs. Non-existing targets are silently ignored resulting in a valid response. " +
|
"target IDs. Non-existing targets are silently ignored resulting in a valid response. " +
|
||||||
"Required permissions: READ_REPOSITORY and UPDATE_TARGET")
|
"Required permissions: READ_REPOSITORY and UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostUpdateResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully assigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
|
||||||
+ "/{distributionSetId}/assignedTargets", consumes = { MediaTypes.HAL_JSON_VALUE,
|
+ "/{distributionSetId}/assignedTargets", consumes = { MediaTypes.HAL_JSON_VALUE,
|
||||||
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
|
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
|
||||||
@@ -484,29 +321,9 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Create a list of meta data for a specific distribution set",
|
@Operation(summary = "Create a list of meta data for a specific distribution set",
|
||||||
description = "Create a list of meta data entries Required permissions: READ_REPOSITORY and UPDATE_TARGET")
|
description = "Create a list of meta data entries Required permissions: READ_REPOSITORY and UPDATE_TARGET")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata",
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata",
|
||||||
@@ -523,25 +340,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return meta data for Distribution Set", description = "Get a paged list of meta data for a " +
|
@Operation(summary = "Return meta data for Distribution Set", description = "Get a paged list of meta data for a " +
|
||||||
"distribution set. Required permission: READ_REPOSITORY")
|
"distribution set. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtMetadata>> getMetadata(@PathVariable("distributionSetId") Long distributionSetId);
|
ResponseEntity<PagedList<MgmtMetadata>> getMetadata(@PathVariable("distributionSetId") Long distributionSetId);
|
||||||
@@ -555,25 +354,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single meta data value for a specific key of a Distribution Set",
|
@Operation(summary = "Return single meta data value for a specific key of a Distribution Set",
|
||||||
description = "Get a single meta data value for a meta data key. Required permission: READ_REPOSITORY")
|
description = "Get a single meta data value for a meta data key. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata/{metadataKey}",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata/{metadataKey}",
|
||||||
produces = { MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtMetadata> getMetadataValue(
|
ResponseEntity<MgmtMetadata> getMetadataValue(
|
||||||
@@ -589,31 +370,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update single meta data value of a distribution set", description = "Update a single meta " +
|
@Operation(summary = "Update single meta data value of a distribution set", description = "Update a single meta " +
|
||||||
"data value for speficic key. Required permission: UPDATE_REPOSITORY")
|
"data value for speficic key. Required permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutNoContentResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully updated"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata/{metadataKey}",
|
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata/{metadataKey}",
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
||||||
ResponseEntity<Void> updateMetadata(
|
ResponseEntity<Void> updateMetadata(
|
||||||
@@ -629,25 +386,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete a single meta data entry from the distribution set", description = "Delete a single " +
|
@Operation(summary = "Delete a single meta data entry from the distribution set", description = "Delete a single " +
|
||||||
"meta data. Required permission: UPDATE_REPOSITORY")
|
"meta data. Required permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata/{metadataKey}")
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/metadata/{metadataKey}")
|
||||||
ResponseEntity<Void> deleteMetadata(
|
ResponseEntity<Void> deleteMetadata(
|
||||||
@PathVariable("distributionSetId") Long distributionSetId,
|
@PathVariable("distributionSetId") Long distributionSetId,
|
||||||
@@ -664,31 +403,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
Handles the POST request for assigning multiple software modules to a distribution set.The request body must
|
Handles the POST request for assigning multiple software modules to a distribution set.The request body must
|
||||||
always be a list of software module IDs. Required permissions: READ_REPOSITORY and UPDATE_REPOSITORY
|
always be a list of software module IDs. Required permissions: READ_REPOSITORY and UPDATE_REPOSITORY
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedSM",
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedSM",
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE },
|
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -705,25 +420,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete the assignment of the software module from the distribution set",
|
@Operation(summary = "Delete the assignment of the software module from the distribution set",
|
||||||
description = "Delete an assignment. Required permission: UPDATE_REPOSITORY")
|
description = "Delete an assignment. Required permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedSM/{softwareModuleId}")
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedSM/{softwareModuleId}")
|
||||||
ResponseEntity<Void> deleteAssignSoftwareModules(
|
ResponseEntity<Void> deleteAssignSoftwareModules(
|
||||||
@PathVariable("distributionSetId") Long distributionSetId,
|
@PathVariable("distributionSetId") Long distributionSetId,
|
||||||
@@ -743,25 +440,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Operation(summary = "Return the assigned software modules of a specific distribution set",
|
@Operation(summary = "Return the assigned software modules of a specific distribution set",
|
||||||
description = "Handles the GET request of retrieving a single distribution set. " +
|
description = "Handles the GET request of retrieving a single distribution set. " +
|
||||||
"Required permission: READ_REPOSITORY")
|
"Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedSM",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/assignedSM",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtSoftwareModule>> getAssignedSoftwareModules(
|
ResponseEntity<PagedList<MgmtSoftwareModule>> getAssignedSoftwareModules(
|
||||||
@@ -792,25 +471,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return Rollouts count by status for Distribution Set", description = "Handles the GET " +
|
@Operation(summary = "Return Rollouts count by status for Distribution Set", description = "Handles the GET " +
|
||||||
"request of retrieving Rollouts count by Status for Distribution Set")
|
"request of retrieving Rollouts count by Status for Distribution Set")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics/rollouts",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics/rollouts",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSetStatistics> getRolloutsCountByStatusForDistributionSet(
|
ResponseEntity<MgmtDistributionSetStatistics> getRolloutsCountByStatusForDistributionSet(
|
||||||
@@ -825,25 +486,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return Actions count by status for Distribution Set", description = "Handles the GET " +
|
@Operation(summary = "Return Actions count by status for Distribution Set", description = "Handles the GET " +
|
||||||
"request of retrieving Actions count by Status for Distribution Set")
|
"request of retrieving Actions count by Status for Distribution Set")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics/actions",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics/actions",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSetStatistics> getActionsCountByStatusForDistributionSet(
|
ResponseEntity<MgmtDistributionSetStatistics> getActionsCountByStatusForDistributionSet(
|
||||||
@@ -857,25 +500,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return Auto Assignments count for Distribution Set", description = "Handles the GET " +
|
@Operation(summary = "Return Auto Assignments count for Distribution Set", description = "Handles the GET " +
|
||||||
"request of retrieving Auto Assignments count for Distribution Set")
|
"request of retrieving Auto Assignments count for Distribution Set")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics/autoassignments",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics/autoassignments",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSetStatistics> getAutoAssignmentsCountForDistributionSet(
|
ResponseEntity<MgmtDistributionSetStatistics> getAutoAssignmentsCountForDistributionSet(
|
||||||
@@ -890,25 +515,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@Operation(summary = "Return Rollouts, Actions and Auto Assignments counts by Status for Distribution Set",
|
@Operation(summary = "Return Rollouts, Actions and Auto Assignments counts by Status for Distribution Set",
|
||||||
description = "Handles the GET request of retrieving Rollouts, Actions and Auto Assignments counts by " +
|
description = "Handles the GET request of retrieving Rollouts, Actions and Auto Assignments counts by " +
|
||||||
"Status for Distribution Set")
|
"Status for Distribution Set")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/statistics",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSetStatistics> getStatisticsForDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
|
ResponseEntity<MgmtDistributionSetStatistics> getStatisticsForDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
|
||||||
@@ -926,31 +533,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
will be removed from all auto assignments. Furthermore, the user can choose to cancel all rollouts and (force)
|
will be removed from all auto assignments. Furthermore, the user can choose to cancel all rollouts and (force)
|
||||||
cancel all actions connected to this distribution set. Required permission: UPDATE_REPOSITORY, UPDATE_TARGET
|
cancel all actions connected to this distribution set. Required permission: UPDATE_REPOSITORY, UPDATE_TARGET
|
||||||
""")
|
""")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully invalidated distribution set"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/invalidate",
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}/invalidate",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
|
|||||||
@@ -10,23 +10,26 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DISTRIBUTION_SET_TAG_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DISTRIBUTION_SET_TAG_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateNoContentResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
|
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag;
|
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateNoContentResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -60,24 +63,7 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all Distribution Set Tags", description = "Handles the GET request of retrieving " +
|
@Operation(summary = "Return all Distribution Set Tags", description = "Handles the GET request of retrieving " +
|
||||||
"all distribution set tags.")
|
"all distribution set tags.")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTag>> getDistributionSetTags(
|
ResponseEntity<PagedList<MgmtTag>> getDistributionSetTags(
|
||||||
@@ -85,7 +71,8 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -111,26 +98,7 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single Distribution Set Tag",
|
@Operation(summary = "Return single Distribution Set Tag",
|
||||||
description = "Handles the GET request of retrieving a single distribution set tag.")
|
description = "Handles the GET request of retrieving a single distribution set tag.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTag> getDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId);
|
ResponseEntity<MgmtTag> getDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId);
|
||||||
@@ -144,30 +112,7 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Creates new Distribution Set Tags", description = "Handles the POST request of creating " +
|
@Operation(summary = "Creates new Distribution Set Tags", description = "Handles the POST request of creating " +
|
||||||
"new distribution set tag. The request body must always be a list of distribution set tags.")
|
"new distribution set tag. The request body must always be a list of distribution set tags.")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -182,32 +127,7 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update Distribution Set Tag",
|
@Operation(summary = "Update Distribution Set Tag",
|
||||||
description = "Handles the PUT request of updating a distribution set tag.")
|
description = "Handles the PUT request of updating a distribution set tag.")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}",
|
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -223,32 +143,7 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete a single distribution set tag",
|
@Operation(summary = "Delete a single distribution set tag",
|
||||||
description = "Handles the DELETE request of deleting a single distribution set tag.")
|
description = "Handles the DELETE request of deleting a single distribution set tag.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}")
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}")
|
||||||
ResponseEntity<Void> deleteDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId);
|
ResponseEntity<Void> deleteDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId);
|
||||||
|
|
||||||
@@ -265,27 +160,8 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all assigned distribution sets by given tag Id",
|
@Operation(summary = "Return all assigned distribution sets by given tag Id",
|
||||||
description = "Handles the GET request of retrieving a list of assigned distributions.")
|
description = "Handles the GET request of retrieving a list of assigned distributions.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_ID_ASSIGNED,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Tag not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING,
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtDistributionSet>> getAssignedDistributionSets(
|
ResponseEntity<PagedList<MgmtDistributionSet>> getAssignedDistributionSets(
|
||||||
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
||||||
@@ -293,7 +169,8 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -320,31 +197,8 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign distribution set to the given tag id",
|
@Operation(summary = "Assign distribution set to the given tag id",
|
||||||
description = "Handles the POST request of distribution assignment. Already assigned distribution will be ignored.")
|
description = "Handles the POST request of distribution assignment. Already assigned distribution will be ignored.")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_ID_ASSIGNED + "/{distributionsetId}")
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING + "/{distributionsetId}")
|
|
||||||
ResponseEntity<Void> assignDistributionSet(
|
ResponseEntity<Void> assignDistributionSet(
|
||||||
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
||||||
@PathVariable("distributionsetId") Long distributionsetId);
|
@PathVariable("distributionsetId") Long distributionsetId);
|
||||||
@@ -358,33 +212,8 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign distribution sets to the given tag id",
|
@Operation(summary = "Assign distribution sets to the given tag id",
|
||||||
description = "Handles the POST request of distribution assignment. Already assigned distribution will be ignored.")
|
description = "Handles the POST request of distribution assignment. Already assigned distribution will be ignored.")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_ID_ASSIGNED,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Not Found - e.g. a distribution set or tags are not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING,
|
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> assignDistributionSets(
|
ResponseEntity<Void> assignDistributionSets(
|
||||||
@@ -400,28 +229,9 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign one distribution set from the given tag id",
|
@Operation(summary = "Unassign one distribution set from the given tag id",
|
||||||
description = "Handles the DELETE request of unassign the given distribution.")
|
description = "Handles the DELETE request of unassign the given distribution.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING +
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING +
|
||||||
MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING + "/{distributionsetId}")
|
MgmtRestConstants.DISTRIBUTIONSET_TAG_ID_ASSIGNED + "/{distributionsetId}")
|
||||||
ResponseEntity<Void> unassignDistributionSet(
|
ResponseEntity<Void> unassignDistributionSet(
|
||||||
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
||||||
@PathVariable("distributionsetId") Long distributionsetId);
|
@PathVariable("distributionsetId") Long distributionsetId);
|
||||||
@@ -435,28 +245,9 @@ public interface MgmtDistributionSetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign multiple distribution sets from the given tag id",
|
@Operation(summary = "Unassign multiple distribution sets from the given tag id",
|
||||||
description = "Handles the DELETE request of unassign the given distribution.")
|
description = "Handles the DELETE request of unassign the given distribution.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Not Found - e.g. a distribution set or tags are not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING +
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING +
|
||||||
MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING)
|
MgmtRestConstants.DISTRIBUTIONSET_TAG_ID_ASSIGNED)
|
||||||
ResponseEntity<Void> unassignDistributionSets(
|
ResponseEntity<Void> unassignDistributionSets(
|
||||||
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
@PathVariable("distributionsetTagId") Long distributionsetTagId,
|
||||||
@RequestBody List<Long> distributionsetIds);
|
@RequestBody List<Long> distributionsetIds);
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DISTRIBUTION_SET_TYPE_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DISTRIBUTION_SET_TYPE_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateNoContentResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -28,7 +34,6 @@ import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionS
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
|
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -62,24 +67,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all Distribution Set Types", description = "Handles the GET request of " +
|
@Operation(summary = "Return all Distribution Set Types", description = "Handles the GET request of " +
|
||||||
"retrieving all distribution set types. Required Permission: READ_REPOSITORY")
|
"retrieving all distribution set types. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtDistributionSetType>> getDistributionSetTypes(
|
ResponseEntity<PagedList<MgmtDistributionSetType>> getDistributionSetTypes(
|
||||||
@@ -87,7 +75,8 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -113,26 +102,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single Distribution Set Type", description = "Handles the GET request of retrieving a " +
|
@Operation(summary = "Return single Distribution Set Type", description = "Handles the GET request of retrieving a " +
|
||||||
"single distribution set type. Required Permission: READ_REPOSITORY")
|
"single distribution set type. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}",
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSetType> getDistributionSetType(
|
ResponseEntity<MgmtDistributionSetType> getDistributionSetType(
|
||||||
@@ -146,26 +116,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete Distribution Set Type by Id", description = "Handles the DELETE request for a single" +
|
@Operation(summary = "Delete Distribution Set Type by Id", description = "Handles the DELETE request for a single" +
|
||||||
" distribution set type. Required Permission: DELETE_REPOSITORY")
|
" distribution set type. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}")
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}")
|
||||||
ResponseEntity<Void> deleteDistributionSetType(@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
ResponseEntity<Void> deleteDistributionSetType(@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
||||||
|
|
||||||
@@ -178,32 +129,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update Distribution Set Type", description = "Handles the PUT request for a single " +
|
@Operation(summary = "Update Distribution Set Type", description = "Handles the PUT request for a single " +
|
||||||
"distribution set type. Required Permission: UPDATE_REPOSITORY")
|
"distribution set type. Required Permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}",
|
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -221,30 +147,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Operation(summary = "Create new distribution set types", description = "Handles the POST request for creating " +
|
@Operation(summary = "Create new distribution set types", description = "Handles the POST request for creating " +
|
||||||
"new distribution set types. The request body must always be a list of types. " +
|
"new distribution set types. The request body must always be a list of types. " +
|
||||||
"Required Permission: CREATE_REPOSITORY")
|
"Required Permission: CREATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -260,28 +163,9 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Operation(summary = "Return mandatory Software Module Types in a Distribution Set Type",
|
@Operation(summary = "Return mandatory Software Module Types in a Distribution Set Type",
|
||||||
description = "Handles the GET request of retrieving the list of mandatory software module types in that " +
|
description = "Handles the GET request of retrieving the list of mandatory software module types in that " +
|
||||||
"distribution set type. Required Permission: READ_REPOSITORY")
|
"distribution set type. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES,
|
MgmtRestConstants.MANDATORYMODULETYPES,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<MgmtSoftwareModuleType>> getMandatoryModules(
|
ResponseEntity<List<MgmtSoftwareModuleType>> getMandatoryModules(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
||||||
@@ -297,28 +181,9 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Operation(summary = "Return single mandatory Software Module Type in a Distribution Set Type",
|
@Operation(summary = "Return single mandatory Software Module Type in a Distribution Set Type",
|
||||||
description = "Handles the GET request of retrieving the single mandatory software module type in that " +
|
description = "Handles the GET request of retrieving the single mandatory software module type in that " +
|
||||||
"distribution set type. Required Permission: READ_REPOSITORY")
|
"distribution set type. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}",
|
MgmtRestConstants.MANDATORYMODULETYPES + "/{softwareModuleTypeId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtSoftwareModuleType> getMandatoryModule(
|
ResponseEntity<MgmtSoftwareModuleType> getMandatoryModule(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
||||||
@@ -334,28 +199,9 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Operation(summary = "Return single optional Software Module Type in a Distribution Set Type",
|
@Operation(summary = "Return single optional Software Module Type in a Distribution Set Type",
|
||||||
description = "Handles the GET request of retrieving the single optional software module type in that " +
|
description = "Handles the GET request of retrieving the single optional software module type in that " +
|
||||||
"distribution set type. Required Permission: READ_REPOSITORY")
|
"distribution set type. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}",
|
MgmtRestConstants.OPTIONALMODULETYPES + "/{softwareModuleTypeId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtSoftwareModuleType> getOptionalModule(
|
ResponseEntity<MgmtSoftwareModuleType> getOptionalModule(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
||||||
@@ -370,28 +216,9 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Operation(summary = "Return optional Software Module Types in a Distribution Set Type",
|
@Operation(summary = "Return optional Software Module Types in a Distribution Set Type",
|
||||||
description = "Handles the GET request of retrieving the list of optional software module types in that " +
|
description = "Handles the GET request of retrieving the list of optional software module types in that " +
|
||||||
"distribution set type. Required Permission: READ_REPOSITORY")
|
"distribution set type. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES,
|
MgmtRestConstants.OPTIONALMODULETYPES,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<MgmtSoftwareModuleType>> getOptionalModules(
|
ResponseEntity<List<MgmtSoftwareModuleType>> getOptionalModules(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
||||||
@@ -406,28 +233,9 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
@Operation(summary = "Delete a mandatory module from a Distribution Set Type",
|
@Operation(summary = "Delete a mandatory module from a Distribution Set Type",
|
||||||
description = "Handles the DELETE request for removing a software module type from a single " +
|
description = "Handles the DELETE request for removing a software module type from a single " +
|
||||||
"distribution set type. Required Permission: DELETE_REPOSITORY")
|
"distribution set type. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully removed"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}")
|
MgmtRestConstants.MANDATORYMODULETYPES + "/{softwareModuleTypeId}")
|
||||||
ResponseEntity<Void> removeMandatoryModule(
|
ResponseEntity<Void> removeMandatoryModule(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
||||||
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
|
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
|
||||||
@@ -443,28 +251,9 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
description = "Handles DELETE request for removing an optional module from the distribution set type. " +
|
description = "Handles DELETE request for removing an optional module from the distribution set type. " +
|
||||||
"Note that a DS type cannot be changed after it has been used by a DS. " +
|
"Note that a DS type cannot be changed after it has been used by a DS. " +
|
||||||
"Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY")
|
"Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully removed"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}")
|
MgmtRestConstants.OPTIONALMODULETYPES + "/{softwareModuleTypeId}")
|
||||||
ResponseEntity<Void> removeOptionalModule(
|
ResponseEntity<Void> removeOptionalModule(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
||||||
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
|
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
|
||||||
@@ -480,34 +269,13 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
description = "Handles the POST request for adding a mandatory software module type to a " +
|
description = "Handles the POST request for adding a mandatory software module type to a " +
|
||||||
"distribution set type.Note that a DS type cannot be changed after it has been used by a DS. " +
|
"distribution set type.Note that a DS type cannot be changed after it has been used by a DS. " +
|
||||||
"Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY")
|
"Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY")
|
||||||
|
@PostCreateNoContentResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully added"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES,
|
MgmtRestConstants.MANDATORYMODULETYPES,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> addMandatoryModule(
|
ResponseEntity<Void> addMandatoryModule(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
||||||
@@ -524,34 +292,13 @@ public interface MgmtDistributionSetTypeRestApi {
|
|||||||
description = "Handles the POST request for adding an optional software module type to a " +
|
description = "Handles the POST request for adding an optional software module type to a " +
|
||||||
"distribution set type.Note that a DS type cannot be changed after it has been used by a DS. " +
|
"distribution set type.Note that a DS type cannot be changed after it has been used by a DS. " +
|
||||||
"Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY")
|
"Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY")
|
||||||
|
@PostCreateNoContentResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully added"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
@ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" +
|
||||||
MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES,
|
MgmtRestConstants.OPTIONALMODULETYPES,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> addOptionalModule(
|
ResponseEntity<Void> addOptionalModule(
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DOWNLOAD_ARTIFACT_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.DOWNLOAD_ARTIFACT_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ public interface MgmtDownloadArtifactRestApi {
|
|||||||
* @param artifactId of the related repository Artifact
|
* @param artifactId of the related repository Artifact
|
||||||
* @return responseEntity with status ok if successful
|
* @return responseEntity with status ok if successful
|
||||||
*/
|
*/
|
||||||
|
@GetResponses
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}/download")
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}/download")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
ResponseEntity<InputStream> downloadArtifact(
|
ResponseEntity<InputStream> downloadArtifact(
|
||||||
|
|||||||
@@ -153,23 +153,23 @@ public final class MgmtRestConstants {
|
|||||||
/**
|
/**
|
||||||
* The target URL mapping rest resource.
|
* The target URL mapping rest resource.
|
||||||
*/
|
*/
|
||||||
public static final String TARGET_TARGET_TYPE_V1_REQUEST_MAPPING = "/{targetId}/targettype";
|
public static final String TARGET_TARGET_ID_TARGETTYPE = "/{targetId}/targettype";
|
||||||
/**
|
/**
|
||||||
* The target type URL mapping rest resource.
|
* The target type URL mapping rest resource.
|
||||||
*/
|
*/
|
||||||
public static final String TARGETTYPE_V1_DS_TYPES = "compatibledistributionsettypes";
|
public static final String COMPATIBLEDISTRIBUTIONSETTYPES = "compatibledistributionsettypes";
|
||||||
/**
|
/**
|
||||||
* The tag URL mapping rest resource.
|
* The tag URL mapping rest resource.
|
||||||
*/
|
*/
|
||||||
public static final String TARGET_TAG_TARGETS_REQUEST_MAPPING = "/{targetTagId}/assigned";
|
public static final String TARGET_TAG_ID_ASSIGNED = "/{targetTagId}/assigned";
|
||||||
/**
|
/**
|
||||||
* The tag URL mapping rest resource.
|
* The tag URL mapping rest resource.
|
||||||
*/
|
*/
|
||||||
public static final String DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING = "/{distributionsetTagId}/assigned";
|
public static final String DISTRIBUTIONSET_TAG_ID_ASSIGNED = "/{distributionsetTagId}/assigned";
|
||||||
/**
|
/**
|
||||||
* Target group URL mapping rest resource
|
* Target group URL mapping rest resource
|
||||||
*/
|
*/
|
||||||
public static final String TARGET_GROUP_TARGETS_REQUEST_MAPPING = "/{group}/assigned";
|
public static final String GROUP_ASSIGNED = "/{group}/assigned";
|
||||||
/**
|
/**
|
||||||
* The default offset parameter in case the offset parameter is not present in the request.
|
* The default offset parameter in case the offset parameter is not present in the request.
|
||||||
*
|
*
|
||||||
@@ -227,10 +227,10 @@ public final class MgmtRestConstants {
|
|||||||
* The target URL mapping, href link for type information.
|
* The target URL mapping, href link for type information.
|
||||||
*/
|
*/
|
||||||
public static final String SOFTWAREMODULE_V1_TYPE = "type";
|
public static final String SOFTWAREMODULE_V1_TYPE = "type";
|
||||||
public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES = "optionalmodules";
|
public static final String OPTIONALMODULES = "optionalmodules";
|
||||||
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES = "mandatorymodules";
|
public static final String MANDATORYMODULES = "mandatorymodules";
|
||||||
public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES = "optionalmoduletypes";
|
public static final String OPTIONALMODULETYPES = "optionalmoduletypes";
|
||||||
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes";
|
public static final String MANDATORYMODULETYPES = "mandatorymoduletypes";
|
||||||
/**
|
/**
|
||||||
* Request parameter if the artifact url handler should be used
|
* Request parameter if the artifact url handler should be used
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.ROLLOUT_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.ROLLOUT_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateNoContentResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
@@ -25,8 +31,8 @@ import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBodyPos
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBodyPut;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody;
|
import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateNoContentResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -61,24 +67,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all Rollouts", description = "Handles the GET request of retrieving all rollouts. " +
|
@Operation(summary = "Return all Rollouts", description = "Handles the GET request of retrieving all rollouts. " +
|
||||||
"Required Permission: READ_ROLLOUT")
|
"Required Permission: READ_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
|
ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
|
||||||
@@ -86,7 +75,8 @@ public interface MgmtRolloutRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -115,26 +105,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single Rollout", description = "Handles the GET request of retrieving a single " +
|
@Operation(summary = "Return single Rollout", description = "Handles the GET request of retrieving a single " +
|
||||||
"rollout. Required Permission: READ_ROLLOUT")
|
"rollout. Required Permission: READ_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}",
|
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtRolloutResponseBody> getRollout(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<MgmtRolloutResponseBody> getRollout(@PathVariable("rolloutId") Long rolloutId);
|
||||||
@@ -142,36 +113,13 @@ public interface MgmtRolloutRestApi {
|
|||||||
/**
|
/**
|
||||||
* Handles the POST request for creating rollout.
|
* Handles the POST request for creating rollout.
|
||||||
*
|
*
|
||||||
* @param rolloutCreateBody the rollout body to be created.
|
* @param rolloutRequestBody the rollout body to be created.
|
||||||
* @return In case rollout could successful created the ResponseEntity with status code 201 with the successfully created rollout. In any
|
* @return In case rollout could successful created the ResponseEntity with status code 201 with the successfully created rollout. In any
|
||||||
* failure the JsonResponseExceptionHandler is handling the response.
|
* failure the JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Create a new Rollout",
|
@Operation(summary = "Create a new Rollout",
|
||||||
description = "Handles the POST request of creating new rollout. Required Permission: CREATE_ROLLOUT")
|
description = "Handles the POST request of creating new rollout. Required Permission: CREATE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -187,31 +135,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update Rollout", description = "Handles the UPDATE request for a single " +
|
@Operation(summary = "Update Rollout", description = "Handles the UPDATE request for a single " +
|
||||||
"Rollout. Required permission: UPDATE_ROLLOUT")
|
"Rollout. Required permission: UPDATE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution Set not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further " +
|
|
||||||
"attempts and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}",
|
@PutMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
produces = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
||||||
@@ -230,24 +154,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
description = "Handles the POST request of approving a created rollout. Only possible if approval " +
|
description = "Handles the POST request of approving a created rollout. Only possible if approval " +
|
||||||
"workflow is enabled in system configuration and rollout is in state WAITING_FOR_APPROVAL. " +
|
"workflow is enabled in system configuration and rollout is in state WAITING_FOR_APPROVAL. " +
|
||||||
"Required Permission: APPROVE_ROLLOUT")
|
"Required Permission: APPROVE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully approved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/approve",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/approve",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> approve(
|
ResponseEntity<Void> approve(
|
||||||
@@ -264,24 +171,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
@Operation(summary = "Deny a Rollout", description = "Handles the POST request of denying a created rollout. " +
|
@Operation(summary = "Deny a Rollout", description = "Handles the POST request of denying a created rollout. " +
|
||||||
"Only possible if approval workflow is enabled in system configuration and rollout is in state " +
|
"Only possible if approval workflow is enabled in system configuration and rollout is in state " +
|
||||||
"WAITING_FOR_APPROVAL. Required Permission: APPROVE_ROLLOUT")
|
"WAITING_FOR_APPROVAL. Required Permission: APPROVE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully denied"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deny",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deny",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> deny(
|
ResponseEntity<Void> deny(
|
||||||
@@ -296,24 +186,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Start a Rollout", description = "Handles the POST request of starting a created rollout. " +
|
@Operation(summary = "Start a Rollout", description = "Handles the POST request of starting a created rollout. " +
|
||||||
"Required Permission: HANDLE_ROLLOUT")
|
"Required Permission: HANDLE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully started"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/start",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/start",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> start(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<Void> start(@PathVariable("rolloutId") Long rolloutId);
|
||||||
@@ -326,29 +199,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Pause a Rollout", description = "Handles the POST request of pausing a running rollout. " +
|
@Operation(summary = "Pause a Rollout", description = "Handles the POST request of pausing a running rollout. " +
|
||||||
"Required Permission: HANDLE_ROLLOUT")
|
"Required Permission: HANDLE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully paused"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/pause",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/pause",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> pause(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<Void> pause(@PathVariable("rolloutId") Long rolloutId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the POST request for stopping a rollout.
|
* Handles the POST request for stopping a rollout.
|
||||||
*
|
*
|
||||||
@@ -357,26 +212,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Stop a Rollout", description = "Handles the POST request of stopping a running rollout. " +
|
@Operation(summary = "Stop a Rollout", description = "Handles the POST request of stopping a running rollout. " +
|
||||||
"Required Permission: HANDLE_ROLLOUT")
|
"Required Permission: HANDLE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully stopped"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/stop",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/stop",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> stop(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<Void> stop(@PathVariable("rolloutId") Long rolloutId);
|
||||||
@@ -390,26 +226,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete a Rollout", description = "Handles the DELETE request of deleting a rollout. " +
|
@Operation(summary = "Delete a Rollout", description = "Handles the DELETE request of deleting a rollout. " +
|
||||||
"Required Permission: DELETE_ROLLOUT")
|
"Required Permission: DELETE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}",
|
@DeleteMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> delete(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<Void> delete(@PathVariable("rolloutId") Long rolloutId);
|
||||||
@@ -422,24 +239,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Resume a Rollout", description = "Handles the POST request of resuming a paused rollout. " +
|
@Operation(summary = "Resume a Rollout", description = "Handles the POST request of resuming a paused rollout. " +
|
||||||
"Required Permission: HANDLE_ROLLOUT")
|
"Required Permission: HANDLE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully resumed"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/resume",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/resume",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> resume(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<Void> resume(@PathVariable("rolloutId") Long rolloutId);
|
||||||
@@ -458,26 +258,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all rollout groups referred to a Rollout", description = "Handles the GET request of " +
|
@Operation(summary = "Return all rollout groups referred to a Rollout", description = "Handles the GET request of " +
|
||||||
"retrieving all deploy groups of a specific rollout. Required Permission: READ_ROLLOUT")
|
"retrieving all deploy groups of a specific rollout. Required Permission: READ_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups",
|
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
|
ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
|
||||||
@@ -486,7 +267,8 @@ public interface MgmtRolloutRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -516,26 +298,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single rollout group", description = "Handles the GET request of a single deploy " +
|
@Operation(summary = "Return single rollout group", description = "Handles the GET request of a single deploy " +
|
||||||
"group of a specific rollout. Required Permission: READ_ROLLOUT")
|
"group of a specific rollout. Required Permission: READ_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups/{groupId}",
|
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups/{groupId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtRolloutGroupResponseBody> getRolloutGroup(
|
ResponseEntity<MgmtRolloutGroupResponseBody> getRolloutGroup(
|
||||||
@@ -557,26 +320,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
@Operation(summary = "Return all targets related to a specific rollout group",
|
@Operation(summary = "Return all targets related to a specific rollout group",
|
||||||
description = "Handles the GET request of retrieving all targets of a single deploy group of a specific " +
|
description = "Handles the GET request of retrieving all targets of a single deploy group of a specific " +
|
||||||
"rollout. Required Permissions: READ_ROLLOUT, READ_TARGET.")
|
"rollout. Required Permissions: READ_ROLLOUT, READ_TARGET.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups/{groupId}/targets",
|
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups/{groupId}/targets",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(
|
||||||
@@ -586,7 +330,8 @@ public interface MgmtRolloutRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -612,24 +357,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Force trigger processing next group of a Rollout", description = "Handles the POST request " +
|
@Operation(summary = "Force trigger processing next group of a Rollout", description = "Handles the POST request " +
|
||||||
"of triggering the next group of a rollout. Required Permission: UPDATE_ROLLOUT")
|
"of triggering the next group of a rollout. Required Permission: UPDATE_ROLLOUT")
|
||||||
@ApiResponses(value = {
|
@PostCreateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully triggered"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/triggerNextGroup",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/triggerNextGroup",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> triggerNextGroup(@PathVariable("rolloutId") Long rolloutId);
|
ResponseEntity<Void> triggerNextGroup(@PathVariable("rolloutId") Long rolloutId);
|
||||||
@@ -642,24 +370,9 @@ public interface MgmtRolloutRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Retry a rollout", description = "Handles the POST request of retrying a rollout. " +
|
@Operation(summary = "Retry a rollout", description = "Handles the POST request of retrying a rollout. " +
|
||||||
"Required Permission: CREATE_ROLLOUT")
|
"Required Permission: CREATE_ROLLOUT")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Rollout not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/retry",
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/retry",
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.SOFTWARE_MODULE_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.SOFTWARE_MODULE_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -29,7 +34,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleMeta
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost;
|
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPut;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -63,31 +67,13 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @param md5Sum checksum for uploaded content check
|
* @param md5Sum checksum for uploaded content check
|
||||||
* @param sha1Sum checksum for uploaded content check
|
* @param sha1Sum checksum for uploaded content check
|
||||||
* @param sha256Sum checksum for uploaded content check
|
* @param sha256Sum checksum for uploaded content check
|
||||||
* @return In case all sets could successful be created the ResponseEntity with status code 201 - Created but without ResponseBody. In any
|
* @return In case all sets could be successfully be created the ResponseEntity with status code 201 - Created but without ResponseBody. In any
|
||||||
* failure the JsonResponseExceptionHandler is handling the response.
|
* failure the JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Upload artifact", description = "Handles POST request for artifact upload. Required Permission: CREATE_REPOSITORY")
|
@Operation(summary = "Upload artifact", description = "Handles POST request for artifact upload. Required Permission: CREATE_REPOSITORY")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
@ApiResponse(responseCode = "404", description = "Software Module not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts",
|
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts",
|
||||||
consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -109,26 +95,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
@Operation(summary = "Return all metadata of artifacts assigned to a software module",
|
@Operation(summary = "Return all metadata of artifacts assigned to a software module",
|
||||||
description = "Handles the GET request of retrieving all metadata of artifacts assigned to a " +
|
description = "Handles the GET request of retrieving all metadata of artifacts assigned to a " +
|
||||||
"software module. Required Permission: READ_REPOSITORY")
|
"software module. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found ",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts",
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<MgmtArtifact>> getArtifacts(
|
ResponseEntity<List<MgmtArtifact>> getArtifacts(
|
||||||
@@ -144,25 +111,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return responseEntity with status ok if successful
|
* @return responseEntity with status ok if successful
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single Artifact metadata", description = "Handles the GET request of retrieving a single Artifact metadata request. Required Permission: READ_REPOSITORY")
|
@Operation(summary = "Return single Artifact metadata", description = "Handles the GET request of retrieving a single Artifact metadata request. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}",
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@@ -179,25 +128,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return status OK if delete as successful.
|
* @return status OK if delete as successful.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete artifact by Id", description = "Handles the DELETE request for a single Artifact assigned to a SoftwareModule. Required Permission: DELETE_REPOSITORY")
|
@Operation(summary = "Delete artifact by Id", description = "Handles the DELETE request for a single Artifact assigned to a SoftwareModule. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}")
|
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
ResponseEntity<Void> deleteArtifact(
|
ResponseEntity<Void> deleteArtifact(
|
||||||
@@ -216,24 +147,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all Software modules", description = "Handles the GET request of retrieving all softwaremodules. Required Permission: READ_REPOSITORY")
|
@Operation(summary = "Return all Software modules", description = "Handles the GET request of retrieving all softwaremodules. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtSoftwareModule>> getSoftwareModules(
|
ResponseEntity<PagedList<MgmtSoftwareModule>> getSoftwareModules(
|
||||||
@@ -241,7 +155,8 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -266,26 +181,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return a single softwareModule with status OK.
|
* @return a single softwareModule with status OK.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return Software Module by id", description = "Handles the GET request of retrieving a single softwaremodule. Required Permission: READ_REPOSITORY")
|
@Operation(summary = "Return Software Module by id", description = "Handles the GET request of retrieving a single softwaremodule. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found ",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}",
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtSoftwareModule> getSoftwareModule(@PathVariable("softwareModuleId") Long softwareModuleId);
|
ResponseEntity<MgmtSoftwareModule> getSoftwareModule(@PathVariable("softwareModuleId") Long softwareModuleId);
|
||||||
@@ -298,27 +194,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* failure the JsonResponseExceptionHandler is handling the response.
|
* failure the JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Create Software Module(s)", description = "Handles the POST request of creating new software modules. The request body must always be a list of modules. Required Permission: CREATE_REPOSITORY")
|
@Operation(summary = "Create Software Module(s)", description = "Handles the POST request of creating new software modules. The request body must always be a list of modules. Required Permission: CREATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -332,31 +208,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return status OK if update was successful
|
* @return status OK if update was successful
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Update Software Module", description = "Handles the PUT request for a single softwaremodule within Hawkbit. Required Permission: UPDATE_REPOSITORY")
|
@Operation(summary = "Update Software Module", description = "Handles the PUT request for a single softwaremodule within Hawkbit. Required Permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}",
|
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -371,25 +223,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return status OK if delete was successful.
|
* @return status OK if delete was successful.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete Software Module by Id", description = "Handles the DELETE request for a single softwaremodule within Hawkbit. Required Permission: DELETE_REPOSITORY")
|
@Operation(summary = "Delete Software Module by Id", description = "Handles the DELETE request for a single softwaremodule within Hawkbit. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}")
|
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}")
|
||||||
ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") Long softwareModuleId);
|
ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") Long softwareModuleId);
|
||||||
|
|
||||||
@@ -401,34 +235,14 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return status created if post request is successful with the value of the created metadata
|
* @return status created if post request is successful with the value of the created metadata
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Creates a list of metadata for a specific Software Module", description = "Create a list of metadata entries Required Permission: UPDATE_REPOSITORY")
|
@Operation(summary = "Creates a list of metadata for a specific Software Module", description = "Create a list of metadata entries Required Permission: UPDATE_REPOSITORY")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
@ApiResponse(responseCode = "404", description = "Software Module not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata",
|
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata",
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
||||||
ResponseEntity<Void> createMetadata(@PathVariable("softwareModuleId") Long softwareModuleId, @RequestBody List<MgmtSoftwareModuleMetadata> metadataRest);
|
ResponseEntity<Void> createMetadata(@PathVariable("softwareModuleId") Long softwareModuleId,
|
||||||
|
@RequestBody List<MgmtSoftwareModuleMetadata> metadataRest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a paged list of metadata for a software module.
|
* Gets a paged list of metadata for a software module.
|
||||||
@@ -437,26 +251,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return status OK with the paged list of metadata, if the request is successful
|
* @return status OK with the paged list of metadata, if the request is successful
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return metadata for a Software Module", description = "Get a paged list of metadata for a software module. Required Permission: READ_REPOSITORY")
|
@Operation(summary = "Return metadata for a Software Module", description = "Get a paged list of metadata for a software module. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found ",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata",
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtSoftwareModuleMetadata>> getMetadata(@PathVariable("softwareModuleId") Long softwareModuleId);
|
ResponseEntity<PagedList<MgmtSoftwareModuleMetadata>> getMetadata(@PathVariable("softwareModuleId") Long softwareModuleId);
|
||||||
@@ -469,26 +264,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @return status OK if get request is successful with the value of the metadata
|
* @return status OK if get request is successful with the value of the metadata
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single metadata value for a specific key of a Software Module", description = "Get a single metadata value for a metadata key. Required Permission: READ_REPOSITORY")
|
@Operation(summary = "Return single metadata value for a specific key of a Software Module", description = "Get a single metadata value for a metadata key. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found ",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata/{metadataKey}",
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata/{metadataKey}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtSoftwareModuleMetadata> getMetadataValue(
|
ResponseEntity<MgmtSoftwareModuleMetadata> getMetadataValue(
|
||||||
@@ -503,25 +279,7 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @param metadata body to update
|
* @param metadata body to update
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Update a single metadata value of a Software Module", description = "Update a single metadata value for speficic key. Required Permission: UPDATE_REPOSITORY")
|
@Operation(summary = "Update a single metadata value of a Software Module", description = "Update a single metadata value for speficic key. Required Permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata/{metadataKey}")
|
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata/{metadataKey}")
|
||||||
ResponseEntity<Void> updateMetadata(
|
ResponseEntity<Void> updateMetadata(
|
||||||
@PathVariable("softwareModuleId") Long softwareModuleId,
|
@PathVariable("softwareModuleId") Long softwareModuleId,
|
||||||
@@ -535,25 +293,8 @@ public interface MgmtSoftwareModuleRestApi {
|
|||||||
* @param metadataKey the key of the metadata to delete
|
* @param metadataKey the key of the metadata to delete
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete single metadata entry from the software module", description = "Delete a single metadata. Required Permission: UPDATE_REPOSITORY")
|
@Operation(summary = "Delete single metadata entry from the software module", description = "Delete a single metadata. Required Permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata/{metadataKey}")
|
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/metadata/{metadataKey}")
|
||||||
ResponseEntity<Void> deleteMetadata(@PathVariable("softwareModuleId") Long softwareModuleId, @PathVariable("metadataKey") String metadataKey);
|
ResponseEntity<Void> deleteMetadata(@PathVariable("softwareModuleId") Long softwareModuleId,
|
||||||
|
@PathVariable("metadataKey") String metadataKey);
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,11 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.SOFTWARE_MODULE_TYPE_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.SOFTWARE_MODULE_TYPE_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -26,7 +31,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModule
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost;
|
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPut;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -61,24 +65,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all Software Module Types",
|
@Operation(summary = "Return all Software Module Types",
|
||||||
description = "Handles the GET request of retrieving all software module types. Required Permission: READ_REPOSITORY")
|
description = "Handles the GET request of retrieving all software module types. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtSoftwareModuleType>> getTypes(
|
ResponseEntity<PagedList<MgmtSoftwareModuleType>> getTypes(
|
||||||
@@ -86,7 +73,8 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -112,26 +100,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single Software Module Type",
|
@Operation(summary = "Return single Software Module Type",
|
||||||
description = "Handles the GET request of retrieving a single software module type. Required Permission: READ_REPOSITORY")
|
description = "Handles the GET request of retrieving a single software module type. Required Permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}",
|
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtSoftwareModuleType> getSoftwareModuleType(
|
ResponseEntity<MgmtSoftwareModuleType> getSoftwareModuleType(
|
||||||
@@ -145,26 +114,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete Software Module Type by Id",
|
@Operation(summary = "Delete Software Module Type by Id",
|
||||||
description = "Handles the DELETE request for a single software module type. Required Permission: DELETE_REPOSITORY")
|
description = "Handles the DELETE request for a single software module type. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}")
|
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}")
|
||||||
ResponseEntity<Void> deleteSoftwareModuleType(
|
ResponseEntity<Void> deleteSoftwareModuleType(
|
||||||
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
|
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
|
||||||
@@ -178,32 +128,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update Software Module Type",
|
@Operation(summary = "Update Software Module Type",
|
||||||
description = "Handles the PUT request for a single software module type. Required Permission: UPDATE_REPOSITORY")
|
description = "Handles the PUT request for a single software module type. Required Permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module Type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}",
|
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -221,30 +146,9 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
|||||||
@Operation(summary = "Creates new Software Module Types",
|
@Operation(summary = "Creates new Software Module Types",
|
||||||
description = "Handles the POST request of creating new software module types. The request body must " +
|
description = "Handles the POST request of creating new software module types. The request body must " +
|
||||||
"always be a list of module types. Required Permission: CREATE_REPOSITORY")
|
"always be a list of module types. Required Permission: CREATE_REPOSITORY")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Software Module not found",
|
@ApiResponse(responseCode = "404", description = "Software Module not found",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING,
|
||||||
|
|||||||
@@ -10,22 +10,24 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_FILTER_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_FILTER_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
|
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtDistributionSetAutoAssignment;
|
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtDistributionSetAutoAssignment;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtTargetFilterQuery;
|
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtTargetFilterQuery;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtTargetFilterQueryRequestBody;
|
import org.eclipse.hawkbit.mgmt.json.model.targetfilter.MgmtTargetFilterQueryRequestBody;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -55,26 +57,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
|
|
||||||
@Operation(summary = "Return target filter query by id", description = "Handles the GET request of retrieving a " +
|
@Operation(summary = "Return target filter query by id", description = "Handles the GET request of retrieving a " +
|
||||||
"single target filter query. Required permission: READ_TARGET")
|
"single target filter query. Required permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target filter query not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}",
|
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTargetFilterQuery> getFilter(@PathVariable("filterId") Long filterId);
|
ResponseEntity<MgmtTargetFilterQuery> getFilter(@PathVariable("filterId") Long filterId);
|
||||||
@@ -91,24 +74,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all target filter queries", description = "Handles the GET request of retrieving all target filter queries. Required permission: READ_TARGET")
|
@Operation(summary = "Return all target filter queries", description = "Handles the GET request of retrieving all target filter queries. Required permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTargetFilterQuery>> getFilters(
|
ResponseEntity<PagedList<MgmtTargetFilterQuery>> getFilters(
|
||||||
@@ -116,7 +82,8 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -143,30 +110,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* is returned. In any failure the JsonResponseExceptionHandler is handling the response.
|
* is returned. In any failure the JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Create target filter", description = "Handles the POST request to create a new target filter query. Required permission: CREATE_TARGET")
|
@Operation(summary = "Create target filter", description = "Handles the POST request to create a new target filter query. Required permission: CREATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -183,31 +127,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* @return the updated target filter response which contains all fields including fields which have not been updated
|
* @return the updated target filter response which contains all fields including fields which have not been updated
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Updates target filter query by id", description = "Handles the PUT request of updating a target filter query. Required permission: UPDATE_TARGET")
|
@Operation(summary = "Updates target filter query by id", description = "Handles the PUT request of updating a target filter query. Required permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target filter query not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", consumes = {
|
@PutMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", consumes = {
|
||||||
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
|
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
|
||||||
MediaType.APPLICATION_JSON_VALUE })
|
MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -223,25 +143,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* the response.
|
* the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete target filter by id", description = "Handles the DELETE request of deleting a target filter query. Required permission: DELETE_TARGET")
|
@Operation(summary = "Delete target filter by id", description = "Handles the DELETE request of deleting a target filter query. Required permission: DELETE_TARGET")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target filter query not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}",
|
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> deleteFilter(@PathVariable("filterId") Long filterId);
|
ResponseEntity<Void> deleteFilter(@PathVariable("filterId") Long filterId);
|
||||||
@@ -253,24 +155,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* @return the assigned distribution set with status OK, if none is assigned than {@code null} content (e.g. "{}")
|
* @return the assigned distribution set with status OK, if none is assigned than {@code null} content (e.g. "{}")
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return distribution set for auto assignment of a specific target filter", description = "Handles the GET request of retrieving the auto assign distribution set. Required permission: READ_TARGET")
|
@Operation(summary = "Return distribution set for auto assignment of a specific target filter", description = "Handles the GET request of retrieving the auto assign distribution set. Required permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS",
|
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("filterId") Long filterId);
|
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("filterId") Long filterId);
|
||||||
@@ -285,32 +170,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
@Operation(summary = "Set auto assignment of distribution set for a target filter query",
|
@Operation(summary = "Set auto assignment of distribution set for a target filter query",
|
||||||
description = "Handles the POST request of setting the auto assign distribution set for a target filter " +
|
description = "Handles the POST request of setting the auto assign distribution set for a target filter " +
|
||||||
"query. Required permissions: UPDATE_TARGET and READ_REPOSITORY")
|
"query. Required permissions: UPDATE_TARGET and READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PostUpdateResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target filter not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS",
|
@PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -327,26 +187,7 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
@Operation(summary = "Remove Distribution Set for auto assignment of a target filter",
|
@Operation(summary = "Remove Distribution Set for auto assignment of a target filter",
|
||||||
description = "Removes the auto assign distribution set from the target filter query. " +
|
description = "Removes the auto assign distribution set from the target filter query. " +
|
||||||
"Required permission: UPDATE_TARGET")
|
"Required permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target filter query not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS")
|
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS")
|
||||||
ResponseEntity<Void> deleteAssignedDistributionSet(@PathVariable("filterId") Long filterId);
|
ResponseEntity<Void> deleteAssignedDistributionSet(@PathVariable("filterId") Long filterId);
|
||||||
}
|
}
|
||||||
@@ -10,21 +10,20 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_GROUP_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_GROUP_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutNoContentResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -40,7 +39,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
extensions = @Extension(name = OpenApi.X_HAWKBIT, properties = @ExtensionProperty(name = "order", value = TARGET_GROUP_ORDER)))
|
extensions = @Extension(name = OpenApi.X_HAWKBIT, properties = @ExtensionProperty(name = "order", value = TARGET_GROUP_ORDER)))
|
||||||
public interface MgmtTargetGroupRestApi {
|
public interface MgmtTargetGroupRestApi {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving a list of assigned targets for a specific group. Complex grouping (subgroups) not supported here.
|
* Handles the GET request of retrieving a list of assigned targets for a specific group. Complex grouping (subgroups) not supported here.
|
||||||
* For complex grouping use the analogical resource with query parameter for target group.
|
* For complex grouping use the analogical resource with query parameter for target group.
|
||||||
@@ -56,19 +54,8 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
@Operation(summary = "Return assigned targets for group",
|
@Operation(summary = "Return assigned targets for group",
|
||||||
description = "Handles the GET request of retrieving a list of assigned targets for a specific group. Complex grouping (subgroups) not supported here." +
|
description = "Handles the GET request of retrieving a list of assigned targets for a specific group. Complex grouping (subgroups) not supported here." +
|
||||||
"For complex grouping use the analogical resource with query parameter for target group.")
|
"For complex grouping use the analogical resource with query parameter for target group.")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + MgmtRestConstants.GROUP_ASSIGNED,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_GROUP_TARGETS_REQUEST_MAPPING,
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
|
||||||
@PathVariable
|
@PathVariable
|
||||||
@@ -109,18 +96,7 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
@Operation(summary = "Return assigned targets for group",
|
@Operation(summary = "Return assigned targets for group",
|
||||||
description = "Handles the GET request of retrieving a list of assigned targets for a specific group. Complex grouping (subgroups) is supported here." +
|
description = "Handles the GET request of retrieving a list of assigned targets for a specific group. Complex grouping (subgroups) is supported here." +
|
||||||
"Search could be for specific group, complex group e.g Parent/Child or also for groups including its subgroups")
|
"Search could be for specific group, complex group e.g Parent/Child or also for groups including its subgroups")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
@GetMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargetsWithSubgroups(
|
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargetsWithSubgroups(
|
||||||
@RequestParam(value = "group")
|
@RequestParam(value = "group")
|
||||||
@@ -159,65 +135,33 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
@Operation(summary = "Assign target(s) to given group",
|
@Operation(summary = "Assign target(s) to given group",
|
||||||
description = "Handles the POST request of target assignment. Already assigned target will be ignored. " +
|
description = "Handles the POST request of target assignment. Already assigned target will be ignored. " +
|
||||||
"For complex groups use analogical method with query parameters.")
|
"For complex groups use analogical method with query parameters.")
|
||||||
@ApiResponses(value = {
|
@PutNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
ResponseEntity<Void> assignTargetsToGroupWithSubgroups(
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
@RequestParam("group")
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
@Schema(description = "The target group to be set. Sub-grouping is allowed here - '/' could be used for subgroups") String group,
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_GROUP_TARGETS_REQUEST_MAPPING)
|
|
||||||
ResponseEntity<Void> assignTargetsToGroup(
|
|
||||||
@PathVariable(value = "group")
|
|
||||||
@Schema(description = "The target group to be set. Sub-grouping not allowed here, for sub-grouping use the analogical method with query parameter.")
|
|
||||||
String group,
|
|
||||||
@Schema(description = "List of controller ids to be assigned", example = "[\"controllerId1\", \"controllerId2\"]")
|
@Schema(description = "List of controller ids to be assigned", example = "[\"controllerId1\", \"controllerId2\"]")
|
||||||
@RequestBody List<String> controllerIds
|
@RequestBody List<String> controllerIds
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns targets to a given group.
|
* Assigns targets to a given group.
|
||||||
* Complex (subgroups) are allowed - e.g. Parent/Child
|
|
||||||
*
|
*
|
||||||
* @param group - target group to be assigned
|
* @param group - target group to be assigned
|
||||||
* @param controllerIds - list of controllerIds for targets to be assigned
|
* @param controllerIds - list of controllerIds for targets to be assigned
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign target(s) to given group",
|
@Operation(summary = "Assign target(s) to given group",
|
||||||
description = "Handles the PUT request of assign target group." +
|
description = "Handles the PUT request of target assignment." +
|
||||||
"Subgroups are allowed - e.g. Parent/Child")
|
"Subgroups are NOT allowed here - e.g. Parent/Child")
|
||||||
@ApiResponses(value = {
|
@PutNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + MgmtRestConstants.GROUP_ASSIGNED)
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
ResponseEntity<Void> assignTargetsToGroup(
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
@PathVariable(value = "group")
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
@Schema(description = "The target group to be set. Sub-grouping not allowed here, for sub-grouping use the analogical method with query parameter.")
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
String group,
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
|
||||||
ResponseEntity<Void> assignTargetsToGroupWithSubgroups(
|
|
||||||
@RequestParam("group")
|
|
||||||
@Schema(description = "The target group to be set. Sub-grouping is allowed here - '/' could be used for subgroups")
|
|
||||||
final String group,
|
|
||||||
@Schema(description = "List of controller ids to be assigned", example = "[\"controllerId1\", \"controllerId2\"]")
|
@Schema(description = "List of controller ids to be assigned", example = "[\"controllerId1\", \"controllerId2\"]")
|
||||||
@RequestBody List<String> controllerIds
|
@RequestBody
|
||||||
|
List<String> controllerIds
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,30 +175,16 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
@Operation(summary = "Assign target(s) to given group by rsql",
|
@Operation(summary = "Assign target(s) to given group by rsql",
|
||||||
description = "Handles the PUT request of target group assignment." +
|
description = "Handles the PUT request of target group assignment." +
|
||||||
"Subgroups are NOT allowed here - e.g. Parent/Child")
|
"Subgroups are NOT allowed here - e.g. Parent/Child")
|
||||||
@ApiResponses(value = {
|
@PutNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/{group}")
|
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/{group}")
|
||||||
ResponseEntity<Void> assignTargetsToGroupWithRsql(
|
ResponseEntity<Void> assignTargetsToGroupWithRsql(
|
||||||
@PathVariable final String group,
|
@PathVariable
|
||||||
|
String group,
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH)
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH)
|
||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
final String rsql
|
String rsql
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,24 +194,12 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign targets from their target groups",
|
@Operation(summary = "Unassign targets from their target groups",
|
||||||
description = "Handles the DELETE request to unassign the given target(s).")
|
description = "Handles the DELETE request to unassign the given target(s).")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
@DeleteMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
||||||
ResponseEntity<Void> unassignTargetsFromGroup(
|
ResponseEntity<Void> unassignTargetsFromGroup(
|
||||||
@RequestBody(required = false)
|
@RequestBody(required = false)
|
||||||
@Schema(description = "List of controller ids to be unassigned from their groups", example = "[\"controllerId1\", \"controllerId2\"]")
|
@Schema(description = "List of controller ids to be unassigned from their groups", example = "[\"controllerId1\", \"controllerId2\"]")
|
||||||
List<String> controllerIds
|
List<String> controllerIds
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -289,27 +207,16 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
*
|
*
|
||||||
* @param rsql - filter for the matching targets to be unassigned
|
* @param rsql - filter for the matching targets to be unassigned
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign targets from their target groups",
|
@Operation(summary = "Unassign targets from their target groups by filter",
|
||||||
description = "Handles the DELETE request to unassign the given target(s).")
|
description = "Handles the DELETE request to unassign targets by RSQL filter.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING)
|
@DeleteMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING)
|
||||||
ResponseEntity<Void> unassignTargetsFromGroupByRsql(
|
ResponseEntity<Void> unassignTargetsFromGroupByRsql(
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
final String rsql
|
String rsql
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -318,50 +225,26 @@ public interface MgmtTargetGroupRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all assigned target groups",
|
@Operation(summary = "Return all assigned target groups",
|
||||||
description = "Handles the GET request of retrieving a list of all target groups.")
|
description = "Handles the GET request of retrieving a list of all target groups.")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<String>> getTargetGroups();
|
ResponseEntity<List<String>> getTargetGroups();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assign targets matching a rsql filter to a provided target group
|
* Assign targets matching a rsql filter to a provided target group
|
||||||
|
*
|
||||||
* @param group - target group to be assigned
|
* @param group - target group to be assigned
|
||||||
* @param rsqlParam - rsql filter based on Target fields
|
* @param rsqlParam - rsql filter based on Target fields
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign targets matching a rsql filter to provided target group",
|
@Operation(summary = "Assign targets matching a rsql filter to provided target group",
|
||||||
description = "Assign targets matching a rsql filter to a provided target group" +
|
description = "Assign targets matching a rsql filter to a provided target group" +
|
||||||
"Subgroups are allowed - e.g. Parent/Child")
|
"Subgroups are allowed - e.g. Parent/Child")
|
||||||
@ApiResponses(value = {
|
@PutNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING)
|
@PutMapping(value = MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING)
|
||||||
ResponseEntity<Void> assignTargetsToGroup(
|
ResponseEntity<Void> assignTargetsToGroup(
|
||||||
@RequestParam(name = "group")
|
@RequestParam(name = "group")
|
||||||
@Schema(description = "The target group to be set. Sub-grouping is allowed here - '/' could be used for subgroups")
|
@Schema(description = "The target group to be set. Sub-grouping is allowed here - '/' could be used for subgroups")
|
||||||
final String group,
|
String group,
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH)
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH)
|
||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutNoContentResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -40,8 +46,9 @@ import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAttributes;
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAutoConfirm;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAutoConfirm;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAutoConfirmUpdate;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAutoConfirmUpdate;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateNoContentResponses;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -70,26 +77,7 @@ public interface MgmtTargetRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return target by id", description = "Handles the GET request of retrieving a single target. " +
|
@Operation(summary = "Return target by id", description = "Handles the GET request of retrieving a single target. " +
|
||||||
"Required Permission: READ_TARGET.")
|
"Required Permission: READ_TARGET.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTarget> getTarget(@PathVariable("targetId") String targetId);
|
ResponseEntity<MgmtTarget> getTarget(@PathVariable("targetId") String targetId);
|
||||||
@@ -106,24 +94,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all targets", description = "Handles the GET request of retrieving all targets. Required permission: READ_TARGET")
|
@Operation(summary = "Return all targets", description = "Handles the GET request of retrieving all targets. Required permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getTargets(
|
||||||
@@ -131,7 +102,8 @@ public interface MgmtTargetRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -157,30 +129,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* entities. In any failure the JsonResponseExceptionHandler is handling the response.
|
* entities. In any failure the JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Create target(s)", description = "Handles the POST request of creating new targets. The request body must always be a list of targets. Required Permission: CREATE_TARGET")
|
@Operation(summary = "Create target(s)", description = "Handles the POST request of creating new targets. The request body must always be a list of targets. Required Permission: CREATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -196,31 +145,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return the updated target response which contains all fields also fields which have not updated
|
* @return the updated target response which contains all fields also fields which have not updated
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Update target by id", description = "Handles the PUT request of updating a target. Required Permission: UPDATE_TARGET")
|
@Operation(summary = "Update target by id", description = "Handles the PUT request of updating a target. Required Permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}",
|
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -236,25 +161,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* response.
|
* response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete target by id", description = "Handles the DELETE request of deleting a single target. Required Permission: DELETE_TARGET")
|
@Operation(summary = "Delete target by id", description = "Handles the DELETE request of deleting a single target. Required Permission: DELETE_TARGET")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}")
|
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}")
|
||||||
ResponseEntity<Void> deleteTarget(@PathVariable("targetId") String targetId);
|
ResponseEntity<Void> deleteTarget(@PathVariable("targetId") String targetId);
|
||||||
|
|
||||||
@@ -266,50 +173,21 @@ public interface MgmtTargetRestApi {
|
|||||||
* response.
|
* response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign target type from target.", description = "Remove the target type from a target. The target type will be set to null. Required permission: UPDATE_TARGET")
|
@Operation(summary = "Unassign target type from target.", description = "Remove the target type from a target. The target type will be set to null. Required permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE)
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING)
|
|
||||||
ResponseEntity<Void> unassignTargetType(@PathVariable("targetId") String targetId);
|
ResponseEntity<Void> unassignTargetType(@PathVariable("targetId") String targetId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the POST (assign) request of a target type.
|
* Handles the POST (assign) request of a target type.
|
||||||
*
|
*
|
||||||
* @param targetId the ID of the target
|
* @param targetId the ID of the target
|
||||||
|
* @param targetTypeId the ID of the target type to be assigned
|
||||||
* @return If the given targetId could exists and could be assign Http OK. In any failure the JsonResponseExceptionHandler is handling the
|
* @return If the given targetId could exists and could be assign Http OK. In any failure the JsonResponseExceptionHandler is handling the
|
||||||
* response.
|
* response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign target type to a target", description = "Assign or update the target type of a target. Required permission: UPDATE_TARGET")
|
@Operation(summary = "Assign target type to a target", description = "Assign or update the target type of a target. Required permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING,
|
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> assignTargetType(@PathVariable("targetId") String targetId, @RequestBody MgmtId targetTypeId);
|
ResponseEntity<Void> assignTargetType(@PathVariable("targetId") String targetId, @RequestBody MgmtId targetTypeId);
|
||||||
|
|
||||||
@@ -320,25 +198,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return the target attributes as map response with status OK
|
* @return the target attributes as map response with status OK
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return attributes of a specific target", description = "Handles the GET request of retrieving the attributes of a specific target. Reponse is a key/value list. Required Permission: READ_TARGET")
|
@Operation(summary = "Return attributes of a specific target", description = "Handles the GET request of retrieving the attributes of a specific target. Reponse is a key/value list. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/attributes",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/attributes",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTargetAttributes> getAttributes(@PathVariable("targetId") String targetId);
|
ResponseEntity<MgmtTargetAttributes> getAttributes(@PathVariable("targetId") String targetId);
|
||||||
@@ -356,25 +216,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return actions for a specific target", description = "Handles the GET request of retrieving the full action history of a specific target. Required Permission: READ_TARGET")
|
@Operation(summary = "Return actions for a specific target", description = "Handles the GET request of retrieving the full action history of a specific target. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtAction>> getActionHistory(
|
ResponseEntity<PagedList<MgmtAction>> getActionHistory(
|
||||||
@@ -383,7 +225,8 @@ public interface MgmtTargetRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -401,7 +244,6 @@ public interface MgmtTargetRestApi {
|
|||||||
in the result.""")
|
in the result.""")
|
||||||
String sortParam);
|
String sortParam);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes all actions for the provided target by provided action IDs list
|
* Deletes all actions for the provided target by provided action IDs list
|
||||||
* OR
|
* OR
|
||||||
@@ -412,25 +254,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @param actionIds - Specific action id list for actions to be deleted
|
* @param actionIds - Specific action id list for actions to be deleted
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Deletes all actions for the provided target EXCEPT the latest N actions OR by provided action IDs list.", description = "Deletes/Purges the action history of the target except the last N actions OR deletes only the actions in the provided action ids list. Required Permission: DELETE_REPOSITORY")
|
@Operation(summary = "Deletes all actions for the provided target EXCEPT the latest N actions OR by provided action IDs list.", description = "Deletes/Purges the action history of the target except the last N actions OR deletes only the actions in the provided action ids list. Required Permission: DELETE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted."),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions",
|
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> deleteActionsForTarget(
|
ResponseEntity<Void> deleteActionsForTarget(
|
||||||
@@ -447,25 +271,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return the action
|
* @return the action
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return action by id of a specific target", description = "Handles the GET request of retrieving a specific action on a specific target. Required Permission: READ_TARGET")
|
@Operation(summary = "Return action by id of a specific target", description = "Handles the GET request of retrieving a specific action on a specific target. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtAction> getAction(
|
ResponseEntity<MgmtAction> getAction(
|
||||||
@@ -481,25 +287,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return status no content in case cancellation was successful
|
* @return status no content in case cancellation was successful
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Cancel action for a specific target", description = "Cancels an active action, only active actions can be deleted. Required Permission: UPDATE_TARGET")
|
@Operation(summary = "Cancel action for a specific target", description = "Cancels an active action, only active actions can be deleted. Required Permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Success"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}")
|
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}")
|
||||||
ResponseEntity<Void> cancelAction(
|
ResponseEntity<Void> cancelAction(
|
||||||
@PathVariable("targetId") String targetId,
|
@PathVariable("targetId") String targetId,
|
||||||
@@ -515,31 +303,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return status no content in case cancellation was successful
|
* @return status no content in case cancellation was successful
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Switch an action from soft to forced", description = "Handles the PUT request to switch an action from soft to forced. Required Permission: UPDATE_TARGET.")
|
@Operation(summary = "Switch an action from soft to forced", description = "Handles the PUT request to switch an action from soft to forced. Required Permission: UPDATE_TARGET.")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully updated"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}",
|
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -550,40 +314,17 @@ public interface MgmtTargetRestApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the PUT update request to either 'confirm' or 'deny' single action on a target.
|
* Handles the PUT update request to either 'confirm' or 'deny' single action on a target.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Controls (confirm/deny) actions waiting for confirmation", description = """
|
@Operation(summary = "Controls (confirm/deny) actions waiting for confirmation", description = """
|
||||||
Either confirm or deny an action which is waiting for confirmation.
|
Either confirm or deny an action which is waiting for confirmation.
|
||||||
The action will be transferred into the RUNNING state in case confirming it.
|
The action will be transferred into the RUNNING state in case confirming it.
|
||||||
The action will remain in WAITING_FOR_CONFIRMATION state in case denying it.
|
The action will remain in WAITING_FOR_CONFIRMATION state in case denying it.
|
||||||
Required Permission: READ_REPOSITORY AND UPDATE_TARGET
|
Required Permission: READ_REPOSITORY AND UPDATE_TARGET
|
||||||
""")
|
""")
|
||||||
|
@PutNoContentResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully updated confirmation status of the action"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target or Action not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
@ApiResponse(responseCode = "410", description = "Action is not active anymore.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
})
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}/confirmation",
|
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}/confirmation",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
@@ -606,25 +347,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return status of a specific action on a specific target", description = "Handles the GET request of retrieving a specific action on a specific target. Required Permission: READ_TARGET")
|
@Operation(summary = "Return status of a specific action on a specific target", description = "Handles the GET request of retrieving a specific action on a specific target. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}/status",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}/status",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtActionStatus>> getActionStatusList(
|
ResponseEntity<PagedList<MgmtActionStatus>> getActionStatusList(
|
||||||
@@ -641,25 +364,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return the assigned distribution set with status OK, if none is assigned than {@code null} content (e.g. "{}")
|
* @return the assigned distribution set with status OK, if none is assigned than {@code null} content (e.g. "{}")
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return the assigned distribution set of a specific target", description = "Handles the GET request of retrieving the assigned distribution set of an specific target. Required Permission: READ_TARGET")
|
@Operation(summary = "Return the assigned distribution set of a specific target", description = "Handles the GET request of retrieving the assigned distribution set of an specific target. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/assignedDS",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/assignedDS",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("targetId") String targetId);
|
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("targetId") String targetId);
|
||||||
@@ -674,31 +379,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* targets and the already assigned targets counters
|
* targets and the already assigned targets counters
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Assigns a distribution set to a specific target", description = "Handles the POST request for assigning a distribution set to a specific target. Required Permission: READ_REPOSITORY and UPDATE_TARGET")
|
@Operation(summary = "Assigns a distribution set to a specific target", description = "Handles the POST request for assigning a distribution set to a specific target. Required Permission: READ_REPOSITORY and UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostUpdateResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully assigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/assignedDS",
|
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/assignedDS",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -720,25 +401,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return the assigned installed set with status OK, if none is installed than {@code null} content (e.g. "{}")
|
* @return the assigned installed set with status OK, if none is installed than {@code null} content (e.g. "{}")
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return installed distribution set of a specific target", description = "Handles the GET request of retrieving the installed distribution set of an specific target. Required Permission: READ_TARGET")
|
@Operation(summary = "Return installed distribution set of a specific target", description = "Handles the GET request of retrieving the installed distribution set of an specific target. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/installedDS",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/installedDS",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtDistributionSet> getInstalledDistributionSet(@PathVariable("targetId") String targetId);
|
ResponseEntity<MgmtDistributionSet> getInstalledDistributionSet(@PathVariable("targetId") String targetId);
|
||||||
@@ -749,23 +412,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @param targetId the ID of the target for the metadata
|
* @param targetId the ID of the target for the metadata
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return tags for specific target", description = "Get a paged list of tags for a target. Required permission: READ_REPOSITORY")
|
@Operation(summary = "Return tags for specific target", description = "Get a paged list of tags for a target. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/tags",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/tags",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<MgmtTag>> getTags(@PathVariable("targetId") String targetId);
|
ResponseEntity<List<MgmtTag>> getTags(@PathVariable("targetId") String targetId);
|
||||||
@@ -777,30 +424,9 @@ public interface MgmtTargetRestApi {
|
|||||||
* @param metadataRest the list of metadata entries to create
|
* @param metadataRest the list of metadata entries to create
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Create a list of metadata for a specific target", description = "Create a list of metadata entries Required permissions: READ_REPOSITORY and UPDATE_TARGET")
|
@Operation(summary = "Create a list of metadata for a specific target", description = "Create a list of metadata entries Required permissions: READ_REPOSITORY and UPDATE_TARGET")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
@ApiResponse(responseCode = "404", description = "Target not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata",
|
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata",
|
||||||
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
consumes = { MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
|
||||||
@@ -813,25 +439,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return status OK if get request is successful with the paged list of metadata
|
* @return status OK if get request is successful with the paged list of metadata
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return metadata for specific target", description = "Get a paged list of metadata for a target. Required permission: READ_REPOSITORY")
|
@Operation(summary = "Return metadata for specific target", description = "Get a paged list of metadata for a target. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtMetadata>> getMetadata(@PathVariable("targetId") String targetId);
|
ResponseEntity<PagedList<MgmtMetadata>> getMetadata(@PathVariable("targetId") String targetId);
|
||||||
@@ -844,25 +452,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return status OK if get request is successful with the value of the metadata
|
* @return status OK if get request is successful with the value of the metadata
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return single metadata value for a specific key of a target", description = "Get a single metadata value for a metadata key. Required permission: READ_REPOSITORY")
|
@Operation(summary = "Return single metadata value for a specific key of a target", description = "Get a single metadata value for a metadata key. Required permission: READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}",
|
||||||
produces = { MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtMetadata> getMetadataValue(
|
ResponseEntity<MgmtMetadata> getMetadataValue(
|
||||||
@@ -877,30 +467,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @param metadata update body
|
* @param metadata update body
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Updates a single metadata value of a target", description = "Update a single metadata value for speficic key. Required permission: UPDATE_REPOSITORY")
|
@Operation(summary = "Updates a single metadata value of a target", description = "Update a single metadata value for speficic key. Required permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PutNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully updated"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}")
|
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}")
|
||||||
ResponseEntity<Void> updateMetadata(
|
ResponseEntity<Void> updateMetadata(
|
||||||
@PathVariable("targetId") String targetId,
|
@PathVariable("targetId") String targetId,
|
||||||
@@ -915,27 +482,11 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return status OK if the delete request is successful
|
* @return status OK if the delete request is successful
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Deletes a single metadata entry from a target", description = "Delete a single metadata. Required permission: UPDATE_REPOSITORY")
|
@Operation(summary = "Deletes a single metadata entry from a target", description = "Delete a single metadata. Required permission: UPDATE_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}")
|
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}")
|
||||||
ResponseEntity<Void> deleteMetadata(@PathVariable("targetId") String targetId, @PathVariable("metadataKey") String metadataKey);
|
ResponseEntity<Void> deleteMetadata(
|
||||||
|
@PathVariable("targetId") String targetId,
|
||||||
|
@PathVariable("metadataKey") String metadataKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current auto-confirm state for a specific target.
|
* Get the current auto-confirm state for a specific target.
|
||||||
@@ -944,27 +495,11 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return the current state as {@link MgmtTargetAutoConfirm}
|
* @return the current state as {@link MgmtTargetAutoConfirm}
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return the current auto-confitm state for a specific target", description = "Handles the GET request to check the current auto-confirmation state of a target. Required Permission: READ_TARGET")
|
@Operation(summary = "Return the current auto-confitm state for a specific target", description = "Handles the GET request to check the current auto-confirmation state of a target. Required Permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm",
|
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTargetAutoConfirm> getAutoConfirmStatus(@PathVariable("targetId") String targetId);
|
ResponseEntity<MgmtTargetAutoConfirm> getAutoConfirmStatus(
|
||||||
|
@PathVariable("targetId") String targetId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate auto-confirm on a specific target.
|
* Activate auto-confirm on a specific target.
|
||||||
@@ -974,31 +509,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return {@link org.springframework.http.HttpStatus#OK} in case of a success
|
* @return {@link org.springframework.http.HttpStatus#OK} in case of a success
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Activate auto-confirm on a specific target", description = "Handles the POST request to activate auto-confirmation for a specific target. As a result all current active as well as future actions will automatically be confirmed by mentioning the initiator as triggered person. Actions will be automatically confirmed, as long as auto-confirmation is active. Required Permission: UPDATE_TARGET")
|
@Operation(summary = "Activate auto-confirm on a specific target", description = "Handles the POST request to activate auto-confirmation for a specific target. As a result all current active as well as future actions will automatically be confirmed by mentioning the initiator as triggered person. Actions will be automatically confirmed, as long as auto-confirmation is active. Required Permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully activated auto-confirm"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm/activate")
|
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm/activate")
|
||||||
ResponseEntity<Void> activateAutoConfirm(
|
ResponseEntity<Void> activateAutoConfirm(
|
||||||
@PathVariable("targetId") String targetId,
|
@PathVariable("targetId") String targetId,
|
||||||
@@ -1011,31 +522,7 @@ public interface MgmtTargetRestApi {
|
|||||||
* @return {@link org.springframework.http.HttpStatus#OK} in case of a success
|
* @return {@link org.springframework.http.HttpStatus#OK} in case of a success
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Deactivate auto-confirm on a specific target", description = "Handles the POST request to deactivate auto-confirmation for a specific target. All active actions will remain unchanged while all future actions need to be confirmed, before processing with the deployment. Required Permission: UPDATE_TARGET")
|
@Operation(summary = "Deactivate auto-confirm on a specific target", description = "Handles the POST request to deactivate auto-confirmation for a specific target. All active actions will remain unchanged while all future actions need to be confirmed, before processing with the deployment. Required Permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deactivated auto-confirm"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm/deactivate")
|
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm/deactivate")
|
||||||
ResponseEntity<Void> deactivateAutoConfirm(
|
ResponseEntity<Void> deactivateAutoConfirm(
|
||||||
@PathVariable("targetId") String targetId);
|
@PathVariable("targetId") String targetId);
|
||||||
|
|||||||
@@ -10,23 +10,26 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_TAG_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_TAG_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag;
|
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateNoContentResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -60,26 +63,16 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all target tags",
|
@Operation(summary = "Return all target tags",
|
||||||
description = "Handles the GET request of retrieving all target tags.")
|
description = "Handles the GET request of retrieving all target tags.")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = TARGET_TAG_V1_REQUEST_MAPPING,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING,
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTag>> getTargetTags(
|
ResponseEntity<PagedList<MgmtTag>> getTargetTags(
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -105,21 +98,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return target tag by id",
|
@Operation(summary = "Return target tag by id",
|
||||||
description = "Handles the GET request of retrieving a single target tag.")
|
description = "Handles the GET request of retrieving a single target tag.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}",
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}",
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTag> getTargetTag(@PathVariable("targetTagId") Long targetTagId);
|
ResponseEntity<MgmtTag> getTargetTag(@PathVariable("targetTagId") Long targetTagId);
|
||||||
|
|
||||||
@@ -132,23 +112,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Create target tag(s)", description = "Handles the POST request of creating new target tag. " +
|
@Operation(summary = "Create target tag(s)", description = "Handles the POST request of creating new target tag. " +
|
||||||
"The request body must always be a list of target tags.")
|
"The request body must always be a list of target tags.")
|
||||||
@ApiResponses(value = {
|
@PostCreateResponses
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
@PostMapping(value = TARGET_TAG_V1_REQUEST_MAPPING,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING,
|
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<MgmtTag>> createTargetTags(@RequestBody List<MgmtTagRequestBodyPut> tags);
|
ResponseEntity<List<MgmtTag>> createTargetTags(@RequestBody List<MgmtTagRequestBodyPut> tags);
|
||||||
@@ -161,25 +126,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
* @return status OK if update is successful and the updated target tag.
|
* @return status OK if update is successful and the updated target tag.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Update target tag by id", description = "Handles the PUT request of updating a target tag.")
|
@Operation(summary = "Update target tag by id", description = "Handles the PUT request of updating a target tag.")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully updated"),
|
@PutMapping(value = TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}",
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}",
|
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTag> updateTargetTag(
|
ResponseEntity<MgmtTag> updateTargetTag(
|
||||||
@@ -194,21 +142,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete target tag by id",
|
@Operation(summary = "Delete target tag by id",
|
||||||
description = "Handles the DELETE request of deleting a single target tag.")
|
description = "Handles the DELETE request of deleting a single target tag.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
@DeleteMapping(value = TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}")
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target tag not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}")
|
|
||||||
ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") Long targetTagId);
|
ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") Long targetTagId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -224,21 +159,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return assigned targets for tag",
|
@Operation(summary = "Return assigned targets for tag",
|
||||||
description = "Handles the GET request of retrieving a list of assigned targets.")
|
description = "Handles the GET request of retrieving a list of assigned targets.")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_ID_ASSIGNED,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target tag not found",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING,
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
|
||||||
@PathVariable("targetTagId") Long targetTagId,
|
@PathVariable("targetTagId") Long targetTagId,
|
||||||
@@ -246,7 +168,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -273,24 +196,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign target(s) to given tagId",
|
@Operation(summary = "Assign target(s) to given tagId",
|
||||||
description = "Handles the POST request of target assignment. Already assigned target will be ignored.")
|
description = "Handles the POST request of target assignment. Already assigned target will be ignored.")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
@PostMapping(value = TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_ID_ASSIGNED + "/{controllerId}")
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING +
|
|
||||||
MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/{controllerId}")
|
|
||||||
ResponseEntity<Void> assignTarget(
|
ResponseEntity<Void> assignTarget(
|
||||||
@PathVariable("targetTagId") Long targetTagId,
|
@PathVariable("targetTagId") Long targetTagId,
|
||||||
@PathVariable("controllerId") String controllerId);
|
@PathVariable("controllerId") String controllerId);
|
||||||
@@ -304,26 +211,9 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Assign target(s) to given tagId",
|
@Operation(summary = "Assign target(s) to given tagId",
|
||||||
description = "Handles the POST request of target assignment. Already assigned target will be ignored.")
|
description = "Handles the POST request of target assignment. Already assigned target will be ignored.")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully assigned"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Not Found - e.g. target tag not found. Contains info about not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request."),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@PostMapping(
|
@PostMapping(
|
||||||
value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING,
|
value = TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_ID_ASSIGNED,
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> assignTargets(
|
ResponseEntity<Void> assignTargets(
|
||||||
@PathVariable("targetTagId") Long targetTagId,
|
@PathVariable("targetTagId") Long targetTagId,
|
||||||
@@ -340,22 +230,9 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign target from a given tagId",
|
@Operation(summary = "Unassign target from a given tagId",
|
||||||
description = "Handles the DELETE request to unassign the given target.")
|
description = "Handles the DELETE request to unassign the given target.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
@DeleteMapping(value = TARGET_TAG_V1_REQUEST_MAPPING +
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
MgmtRestConstants.TARGET_TAG_ID_ASSIGNED + "/{controllerId}")
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING +
|
|
||||||
MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/{controllerId}")
|
|
||||||
ResponseEntity<Void> unassignTarget(
|
ResponseEntity<Void> unassignTarget(
|
||||||
@PathVariable("targetTagId") Long targetTagId,
|
@PathVariable("targetTagId") Long targetTagId,
|
||||||
@PathVariable("controllerId") String controllerId);
|
@PathVariable("controllerId") String controllerId);
|
||||||
@@ -369,21 +246,8 @@ public interface MgmtTargetTagRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Unassign targets from a given tagId",
|
@Operation(summary = "Unassign targets from a given tagId",
|
||||||
description = "Handles the DELETE request to unassign the given targets.")
|
description = "Handles the DELETE request to unassign the given targets.")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully unassigned"),
|
@DeleteMapping(value = TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_ID_ASSIGNED,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth."),
|
|
||||||
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
|
|
||||||
"changed (i.e. read-only) or data volume restriction applies."),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Not Found - e.g. target tag not found. Contains info about not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource."),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json."),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.")
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING,
|
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> unassignTargets(
|
ResponseEntity<Void> unassignTargets(
|
||||||
@PathVariable("targetTagId") Long targetTagId,
|
@PathVariable("targetTagId") Long targetTagId,
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_TYPE_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TARGET_TYPE_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PostCreateResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -27,8 +32,8 @@ import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionS
|
|||||||
import org.eclipse.hawkbit.mgmt.json.model.targettype.MgmtTargetType;
|
import org.eclipse.hawkbit.mgmt.json.model.targettype.MgmtTargetType;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.targettype.MgmtTargetTypeRequestBodyPost;
|
import org.eclipse.hawkbit.mgmt.json.model.targettype.MgmtTargetTypeRequestBodyPost;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.targettype.MgmtTargetTypeRequestBodyPut;
|
import org.eclipse.hawkbit.mgmt.json.model.targettype.MgmtTargetTypeRequestBodyPut;
|
||||||
|
import org.eclipse.hawkbit.rest.ApiResponsesConstants.PostUpdateNoContentResponses;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -61,24 +66,7 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all target types", description = "Handles the GET request of retrieving all target types.")
|
@Operation(summary = "Return all target types", description = "Handles the GET request of retrieving all target types.")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtTargetType>> getTargetTypes(
|
ResponseEntity<PagedList<MgmtTargetType>> getTargetTypes(
|
||||||
@@ -86,7 +74,8 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
@Schema(description = """
|
@Schema(description = """
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
available fields.""")
|
available fields.""")
|
||||||
String rsqlParam, @RequestParam(
|
String rsqlParam,
|
||||||
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -112,26 +101,7 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return target type by id",
|
@Operation(summary = "Return target type by id",
|
||||||
description = "Handles the GET request of retrieving a single target type")
|
description = "Handles the GET request of retrieving a single target type")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}",
|
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtTargetType> getTargetType(@PathVariable("targetTypeId") Long targetTypeId);
|
ResponseEntity<MgmtTargetType> getTargetType(@PathVariable("targetTypeId") Long targetTypeId);
|
||||||
@@ -144,26 +114,7 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Delete target type by id",
|
@Operation(summary = "Delete target type by id",
|
||||||
description = "Handles the DELETE request for a single target type. Required Permission: DELETE_TARGET")
|
description = "Handles the DELETE request for a single target type. Required Permission: DELETE_TARGET")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}")
|
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}")
|
||||||
ResponseEntity<Void> deleteTargetType(@PathVariable("targetTypeId") Long targetTypeId);
|
ResponseEntity<Void> deleteTargetType(@PathVariable("targetTypeId") Long targetTypeId);
|
||||||
|
|
||||||
@@ -176,32 +127,7 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Update target type by id",
|
@Operation(summary = "Update target type by id",
|
||||||
description = "Handles the PUT request for a single target type. Required Permission: UPDATE_TARGET")
|
description = "Handles the PUT request for a single target type. Required Permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully updated"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target type not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}",
|
@PutMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -218,30 +144,9 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Create target types", description = "Handles the POST request for creating new target " +
|
@Operation(summary = "Create target types", description = "Handles the POST request for creating new target " +
|
||||||
"types. The request body must always be a list of types. Required Permission: CREATE_TARGET")
|
"types. The request body must always be a list of types. Required Permission: CREATE_TARGET")
|
||||||
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "201", description = "Successfully created"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Target type not found.",
|
@ApiResponse(responseCode = "404", description = "Target type not found.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING,
|
@PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING,
|
||||||
@@ -258,30 +163,10 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
@Operation(summary = "Return list of compatible distribution set types", description = "Handles the GET request " +
|
@Operation(summary = "Return list of compatible distribution set types", description = "Handles the GET request " +
|
||||||
"of retrieving the list of compatible distribution set types in that target type. " +
|
"of retrieving the list of compatible distribution set types in that target type. " +
|
||||||
"Required Permission: READ_TARGET, READ_REPOSITORY")
|
"Required Permission: READ_TARGET, READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" + MgmtRestConstants.COMPATIBLEDISTRIBUTIONSETTYPES,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution set type was not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES,
|
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<List<MgmtDistributionSetType>> getCompatibleDistributionSets(
|
ResponseEntity<List<MgmtDistributionSetType>> getCompatibleDistributionSets(@PathVariable("targetTypeId") Long targetTypeId);
|
||||||
@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.
|
||||||
@@ -293,28 +178,9 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
@Operation(summary = "Remove compatibility of distribution set type from the target type",
|
@Operation(summary = "Remove compatibility of distribution set type from the target type",
|
||||||
description = "Handles the DELETE request for removing a distribution set type from a single target type. " +
|
description = "Handles the DELETE request for removing a distribution set type from a single target type. " +
|
||||||
"Required Permission: UPDATE_TARGET and READ_REPOSITORY")
|
"Required Permission: UPDATE_TARGET and READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully removed"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution set type was not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" +
|
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" +
|
||||||
MgmtRestConstants.TARGETTYPE_V1_DS_TYPES + "/{distributionSetTypeId}")
|
MgmtRestConstants.COMPATIBLEDISTRIBUTIONSETTYPES + "/{distributionSetTypeId}")
|
||||||
ResponseEntity<Void> removeCompatibleDistributionSet(
|
ResponseEntity<Void> removeCompatibleDistributionSet(
|
||||||
@PathVariable("targetTypeId") Long targetTypeId,
|
@PathVariable("targetTypeId") Long targetTypeId,
|
||||||
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
|
||||||
@@ -329,33 +195,8 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
@Operation(summary = "Adding compatibility of a distribution set type to a target type",
|
@Operation(summary = "Adding compatibility of a distribution set type to a target type",
|
||||||
description = "Handles the POST request for adding compatible distribution set types to a target type. " +
|
description = "Handles the POST request for adding compatible distribution set types to a target type. " +
|
||||||
"Required Permission: UPDATE_TARGET and READ_REPOSITORY")
|
"Required Permission: UPDATE_TARGET and READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@PostUpdateNoContentResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully added"),
|
@PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" + MgmtRestConstants.COMPATIBLEDISTRIBUTIONSETTYPES,
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Distribution set type was not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES,
|
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Void> addCompatibleDistributionSets(
|
ResponseEntity<Void> addCompatibleDistributionSets(
|
||||||
@PathVariable("targetTypeId") Long targetTypeId,
|
@PathVariable("targetTypeId") Long targetTypeId,
|
||||||
|
|||||||
@@ -10,21 +10,20 @@
|
|||||||
package org.eclipse.hawkbit.mgmt.rest.api;
|
package org.eclipse.hawkbit.mgmt.rest.api;
|
||||||
|
|
||||||
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TENANT_ORDER;
|
import static org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants.TENANT_ORDER;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.DeleteResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetIfExistResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.GetResponses;
|
||||||
|
import static org.eclipse.hawkbit.rest.ApiResponsesConstants.PutResponses;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.extensions.Extension;
|
import io.swagger.v3.oas.annotations.extensions.Extension;
|
||||||
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValue;
|
import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValue;
|
||||||
import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValueRequest;
|
import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValueRequest;
|
||||||
import org.eclipse.hawkbit.rest.OpenApi;
|
import org.eclipse.hawkbit.rest.OpenApi;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@@ -52,24 +51,7 @@ public interface MgmtTenantManagementRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all tenant specific configuration values", description = "The GET request returns " +
|
@Operation(summary = "Return all tenant specific configuration values", description = "The GET request returns " +
|
||||||
"a list of all possible configuration keys for the tenant. Required Permission: READ_TENANT_CONFIGURATION")
|
"a list of all possible configuration keys for the tenant. Required Permission: READ_TENANT_CONFIGURATION")
|
||||||
@ApiResponses(value = {
|
@GetIfExistResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs",
|
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<Map<String, MgmtSystemTenantConfigurationValue>> getTenantConfiguration();
|
ResponseEntity<Map<String, MgmtSystemTenantConfigurationValue>> getTenantConfiguration();
|
||||||
@@ -84,26 +66,7 @@ public interface MgmtTenantManagementRestApi {
|
|||||||
@Operation(summary = "Return a tenant specific configuration value", description = "The GET request returns the " +
|
@Operation(summary = "Return a tenant specific configuration value", description = "The GET request returns the " +
|
||||||
"configuration value of a specific configuration key for the tenant. " +
|
"configuration value of a specific configuration key for the tenant. " +
|
||||||
"Required Permission: READ_TENANT_CONFIGURATION")
|
"Required Permission: READ_TENANT_CONFIGURATION")
|
||||||
@ApiResponses(value = {
|
@GetResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Configuration key not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}",
|
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<MgmtSystemTenantConfigurationValue> getTenantConfigurationValue(@PathVariable("keyName") String keyName);
|
ResponseEntity<MgmtSystemTenantConfigurationValue> getTenantConfigurationValue(@PathVariable("keyName") String keyName);
|
||||||
@@ -117,32 +80,7 @@ public interface MgmtTenantManagementRestApi {
|
|||||||
@Operation(summary = "Update a tenant specific configuration value.", description = "The PUT request changes a " +
|
@Operation(summary = "Update a tenant specific configuration value.", description = "The PUT request changes a " +
|
||||||
"configuration value of a specific configuration key for the tenant. " +
|
"configuration value of a specific configuration key for the tenant. " +
|
||||||
"Required Permission: TENANT_CONFIGURATION")
|
"Required Permission: TENANT_CONFIGURATION")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "Configuration key not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}",
|
@PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -158,30 +96,7 @@ public interface MgmtTenantManagementRestApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "Batch update of tenant configuration.", description = "The PUT request updates the whole " +
|
@Operation(summary = "Batch update of tenant configuration.", description = "The PUT request updates the whole " +
|
||||||
"configuration for the tenant. Required Permission: TENANT_CONFIGURATION")
|
"configuration for the tenant. Required Permission: TENANT_CONFIGURATION")
|
||||||
@ApiResponses(value = {
|
@PutResponses
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " +
|
|
||||||
"user in another request at the same time. You may retry your modification request.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
|
|
||||||
"supported by the server for this resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs",
|
@PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs",
|
||||||
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@@ -196,26 +111,7 @@ public interface MgmtTenantManagementRestApi {
|
|||||||
@Operation(summary = "Delete a tenant specific configuration value", description = "The DELETE request removes a " +
|
@Operation(summary = "Delete a tenant specific configuration value", description = "The DELETE request removes a " +
|
||||||
"tenant specific configuration value for the tenant. Afterwards the global default value is used. " +
|
"tenant specific configuration value for the tenant. Afterwards the global default value is used. " +
|
||||||
"Required Permission: TENANT_CONFIGURATION")
|
"Required Permission: TENANT_CONFIGURATION")
|
||||||
@ApiResponses(value = {
|
@DeleteResponses
|
||||||
@ApiResponse(responseCode = "204", description = "Successfully deleted"),
|
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
|
|
||||||
@ApiResponse(responseCode = "401", description = "The request requires user auth.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "403",
|
|
||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
|
||||||
"data volume restriction applies.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "The key to remove is not found.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
|
||||||
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
|
|
||||||
"and the client has to wait another second.",
|
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}",
|
@DeleteMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}",
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class MgmtActionResource implements MgmtActionRestApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AuditLog(entity = "Actions",type = AuditLog.Type.DELETE, description = "Delete Action", logResponse = true)
|
@AuditLog(entity = "Actions", type = AuditLog.Type.DELETE, description = "Delete Action", logResponse = true)
|
||||||
public ResponseEntity<Void> deleteAction(Long actionId) {
|
public ResponseEntity<Void> deleteAction(Long actionId) {
|
||||||
deploymentManagement.deleteAction(actionId);
|
deploymentManagement.deleteAction(actionId);
|
||||||
return ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
|||||||
dsTypeKey));
|
dsTypeKey));
|
||||||
}
|
}
|
||||||
return dsType;
|
return dsType;
|
||||||
}).orElseThrow(() -> new EntityNotFoundException(DistributionSetType.class, dsTypeKey))));
|
}).orElseThrow(() -> new EntityNotFoundException(DistributionSetType.class, dsTypeKey))));
|
||||||
|
|
||||||
final Collection<? extends DistributionSet> createdDSets =
|
final Collection<? extends DistributionSet> createdDSets =
|
||||||
distributionSetManagement.create(mgmtDistributionSetMapper.fromRequest(sets, defaultDsKey, dsTypeKeyToDsType));
|
distributionSetManagement.create(mgmtDistributionSetMapper.fromRequest(sets, defaultDsKey, dsTypeKeyToDsType));
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRestApi {
|
|||||||
public ResponseEntity<List<MgmtTag>> createDistributionSetTags(final List<MgmtTagRequestBodyPut> tags) {
|
public ResponseEntity<List<MgmtTag>> createDistributionSetTags(final List<MgmtTagRequestBodyPut> tags) {
|
||||||
log.debug("creating {} ds tags", tags.size());
|
log.debug("creating {} ds tags", tags.size());
|
||||||
|
|
||||||
final List<? extends DistributionSetTag> createdTags = distributionSetTagManagement.create(MgmtDistributionSetMapper.mapTagFromRequest(tags));
|
final List<? extends DistributionSetTag> createdTags = distributionSetTagManagement
|
||||||
|
.create(MgmtDistributionSetMapper.mapTagFromRequest(tags));
|
||||||
return new ResponseEntity<>(MgmtTagMapper.toResponseDistributionSetTag(createdTags), HttpStatus.CREATED);
|
return new ResponseEntity<>(MgmtTagMapper.toResponseDistributionSetTag(createdTags), HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR
|
|||||||
@Override
|
@Override
|
||||||
public ResponseEntity<PagedList<MgmtDistributionSetType>> getDistributionSetTypes(
|
public ResponseEntity<PagedList<MgmtDistributionSetType>> getDistributionSetTypes(
|
||||||
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) {
|
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) {
|
||||||
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeDistributionSetTypeSortParam(sortParam));
|
final Pageable pageable = PagingUtility.toPageable(
|
||||||
|
pagingOffsetParam, pagingLimitParam, sanitizeDistributionSetTypeSortParam(sortParam));
|
||||||
final Slice<? extends DistributionSetType> findModuleTypesAll;
|
final Slice<? extends DistributionSetType> findModuleTypesAll;
|
||||||
long countModulesAll;
|
long countModulesAll;
|
||||||
if (rsqlParam != null) {
|
if (rsqlParam != null) {
|
||||||
|
|||||||
@@ -263,7 +263,8 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Void> updateMetadata(final Long softwareModuleId, final String metadataKey, final MgmtSoftwareModuleMetadataBodyPut metadata) {
|
public ResponseEntity<Void> updateMetadata(
|
||||||
|
final Long softwareModuleId, final String metadataKey, final MgmtSoftwareModuleMetadataBodyPut metadata) {
|
||||||
softwareModuleManagement.createMetadata(
|
softwareModuleManagement.createMetadata(
|
||||||
softwareModuleId, metadataKey, new MetadataValueCreate(metadata.getValue(), metadata.getTargetVisible()));
|
softwareModuleId, metadataKey, new MetadataValueCreate(metadata.getValue(), metadata.getTargetVisible()));
|
||||||
return ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
|
|||||||
@@ -249,16 +249,6 @@ public class MgmtTargetResource implements MgmtTargetRestApi {
|
|||||||
.orElseGet(() -> ResponseEntity.notFound().build());
|
.orElseGet(() -> ResponseEntity.notFound().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Action> getValidatedAction(final String targetId, final Long actionId) {
|
|
||||||
final Action action = deploymentManagement.findAction(actionId)
|
|
||||||
.orElseThrow(() -> new EntityNotFoundException(Action.class, actionId));
|
|
||||||
if (!action.getTarget().getControllerId().equals(targetId)) {
|
|
||||||
log.warn(ACTION_TARGET_MISSING_ASSIGN_WARN, action.getId(), targetId);
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
return Optional.of(action);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AuditLog(entity = "Target", type = AuditLog.Type.UPDATE, description = "Cancel Target Action")
|
@AuditLog(entity = "Target", type = AuditLog.Type.UPDATE, description = "Cancel Target Action")
|
||||||
public ResponseEntity<Void> cancelAction(final String targetId, final Long actionId, final boolean force) {
|
public ResponseEntity<Void> cancelAction(final String targetId, final Long actionId, final boolean force) {
|
||||||
@@ -479,6 +469,16 @@ public class MgmtTargetResource implements MgmtTargetRestApi {
|
|||||||
return ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Optional<Action> getValidatedAction(final String targetId, final Long actionId) {
|
||||||
|
final Action action = deploymentManagement.findAction(actionId)
|
||||||
|
.orElseThrow(() -> new EntityNotFoundException(Action.class, actionId));
|
||||||
|
if (!action.getTarget().getControllerId().equals(targetId)) {
|
||||||
|
log.warn(ACTION_TARGET_MISSING_ASSIGN_WARN, action.getId(), targetId);
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
return Optional.of(action);
|
||||||
|
}
|
||||||
|
|
||||||
private <T, R> R getNullIfEmpty(final T object, final Function<T, R> extractMethod) {
|
private <T, R> R getNullIfEmpty(final T object, final Function<T, R> extractMethod) {
|
||||||
return ObjectUtils.isEmpty(object) ? null : extractMethod.apply(object);
|
return ObjectUtils.isEmpty(object) ? null : extractMethod.apply(object);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class MgmtTargetTypeResource implements MgmtTargetTypeRestApi {
|
|||||||
findTargetTypes = targetTypeManagement.findAll(pageable);
|
findTargetTypes = targetTypeManagement.findAll(pageable);
|
||||||
}
|
}
|
||||||
return ResponseEntity.ok(
|
return ResponseEntity.ok(
|
||||||
new PagedList<>(MgmtTargetTypeMapper.toListResponse(findTargetTypes.getContent()), findTargetTypes.getTotalElements()));
|
new PagedList<>(MgmtTargetTypeMapper.toListResponse(findTargetTypes.getContent()), findTargetTypes.getTotalElements()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -76,10 +76,10 @@ public final class MgmtDistributionSetTypeMapper {
|
|||||||
public static void addLinks(final MgmtDistributionSetType result) {
|
public static void addLinks(final MgmtDistributionSetType result) {
|
||||||
|
|
||||||
result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getMandatoryModules(result.getId()))
|
result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getMandatoryModules(result.getId()))
|
||||||
.withRel(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES).expand());
|
.withRel(MgmtRestConstants.MANDATORYMODULES).expand());
|
||||||
|
|
||||||
result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getOptionalModules(result.getId()))
|
result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getOptionalModules(result.getId()))
|
||||||
.withRel(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES).expand());
|
.withRel(MgmtRestConstants.OPTIONALMODULES).expand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private DistributionSetTypeManagement.Create fromRequest(final MgmtDistributionSetTypeRequestBodyPost smsRest) {
|
private DistributionSetTypeManagement.Create fromRequest(final MgmtDistributionSetTypeRequestBodyPost smsRest) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public final class MgmtTargetTypeMapper {
|
|||||||
|
|
||||||
public static void addLinks(final MgmtTargetType result) {
|
public static void addLinks(final MgmtTargetType result) {
|
||||||
result.add(linkTo(methodOn(MgmtTargetTypeRestApi.class).getCompatibleDistributionSets(result.getId()))
|
result.add(linkTo(methodOn(MgmtTargetTypeRestApi.class).getCompatibleDistributionSets(result.getId()))
|
||||||
.withRel(MgmtRestConstants.TARGETTYPE_V1_DS_TYPES).expand());
|
.withRel(MgmtRestConstants.COMPATIBLEDISTRIBUTIONSETTYPES).expand());
|
||||||
}
|
}
|
||||||
|
|
||||||
private TargetTypeManagement.Create fromRequest(final MgmtTargetTypeRequestBodyPost targetTypesRest) {
|
private TargetTypeManagement.Create fromRequest(final MgmtTargetTypeRequestBodyPost targetTypesRest) {
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ class JsonBuilder {
|
|||||||
|
|
||||||
private static RolloutGroupConditions getConditions(final RolloutGroup rolloutGroup) {
|
private static RolloutGroupConditions getConditions(final RolloutGroup rolloutGroup) {
|
||||||
if (rolloutGroup == null) {
|
if (rolloutGroup == null) {
|
||||||
return new RolloutGroupConditionBuilder().withDefaults().build();
|
return new RolloutGroupConditionBuilder().withDefaults().build();
|
||||||
} else {
|
} else {
|
||||||
return new RolloutGroupConditionBuilder()
|
return new RolloutGroupConditionBuilder()
|
||||||
.errorCondition(rolloutGroup.getErrorCondition(), rolloutGroup.getErrorConditionExp())
|
.errorCondition(rolloutGroup.getErrorCondition(), rolloutGroup.getErrorConditionExp())
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest {
|
|||||||
actionIdsToDelete.add(deletedActionId2);
|
actionIdsToDelete.add(deletedActionId2);
|
||||||
|
|
||||||
mvc.perform(delete(MgmtRestConstants.ACTION_V1_REQUEST_MAPPING)
|
mvc.perform(delete(MgmtRestConstants.ACTION_V1_REQUEST_MAPPING)
|
||||||
.content(toJson(actionIdsToDelete)).contentType(APPLICATION_JSON))
|
.content(toJson(actionIdsToDelete)).contentType(APPLICATION_JSON))
|
||||||
.andExpect(status().isNoContent());
|
.andExpect(status().isNoContent());
|
||||||
|
|
||||||
mvc.perform(get(ACTION_V1_REQUEST_MAPPING + "/" + deletedActionId1))
|
mvc.perform(get(ACTION_V1_REQUEST_MAPPING + "/" + deletedActionId1))
|
||||||
@@ -581,6 +581,19 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest {
|
|||||||
.andExpect(status().isBadRequest());
|
.andExpect(status().isBadRequest());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String generateActionLink(final String targetId, final Long actionId) {
|
||||||
|
return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING +
|
||||||
|
"/" + targetId + "/" + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String generateTargetLink(final String targetId) {
|
||||||
|
return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + targetId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String generateDistributionSetLink(final Action action) {
|
||||||
|
return "http://localhost" + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + action.getDistributionSet().getId();
|
||||||
|
}
|
||||||
|
|
||||||
private List<DistributionSetAssignmentResult> createTargetsAndPerformAssignment(int n) {
|
private List<DistributionSetAssignmentResult> createTargetsAndPerformAssignment(int n) {
|
||||||
final List<Target> targets = new ArrayList<>();
|
final List<Target> targets = new ArrayList<>();
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
@@ -595,19 +608,6 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest {
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String generateActionLink(final String targetId, final Long actionId) {
|
|
||||||
return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING +
|
|
||||||
"/" + targetId + "/" + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String generateTargetLink(final String targetId) {
|
|
||||||
return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + targetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String generateDistributionSetLink(final Action action) {
|
|
||||||
return "http://localhost" + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + action.getDistributionSet().getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void verifyResultsByTargetPropertyFilter(final Target target, final DistributionSet ds, final String rsqlTargetFilter)
|
private void verifyResultsByTargetPropertyFilter(final Target target, final DistributionSet ds, final String rsqlTargetFilter)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
// pending status one result
|
// pending status one result
|
||||||
|
|||||||
@@ -71,19 +71,18 @@ import org.springframework.web.context.WebApplicationContext;
|
|||||||
classes = { MgmtApiConfiguration.class, RestConfiguration.class, JpaRepositoryConfiguration.class, TestConfiguration.class })
|
classes = { MgmtApiConfiguration.class, RestConfiguration.class, JpaRepositoryConfiguration.class, TestConfiguration.class })
|
||||||
class MgmtBasicAuthResourceTest {
|
class MgmtBasicAuthResourceTest {
|
||||||
|
|
||||||
private static final String DEFAULT_TENANT = "DEFAULT";
|
|
||||||
private static final String TEST_USER = "testUser";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected WebApplicationContext webApplicationContext;
|
protected WebApplicationContext webApplicationContext;
|
||||||
@Autowired
|
@Autowired
|
||||||
MockMvc defaultMock;
|
MockMvc defaultMock;
|
||||||
|
private static final String DEFAULT_TENANT = "DEFAULT";
|
||||||
|
private static final String TEST_USER = "testUser";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of userinfo api with basic authentication validation
|
* Test of userinfo api with basic authentication validation
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@WithUser(principal = TEST_USER, authorities = {"READ", "WRITE", "DELETE"})
|
@WithUser(principal = TEST_USER, authorities = { "READ", "WRITE", "DELETE" })
|
||||||
void validateBasicAuthWithUserDetails() throws Exception {
|
void validateBasicAuthWithUserDetails() throws Exception {
|
||||||
withSecurityMock().perform(get(MgmtRestConstants.AUTH_V1_REQUEST_MAPPING))
|
withSecurityMock().perform(get(MgmtRestConstants.AUTH_V1_REQUEST_MAPPING))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
|
|||||||
@@ -1831,6 +1831,22 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe
|
|||||||
Arguments.of(false, false), Arguments.of(true, null), Arguments.of(false, null));
|
Arguments.of(false, false), Arguments.of(true, null), Arguments.of(false, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<MgmtDistributionSetRequestBodyPut> toMgmtDistributionSetPost(final List<DistributionSetManagement.Create> creates) {
|
||||||
|
return creates.stream()
|
||||||
|
.map(create ->
|
||||||
|
new MgmtDistributionSetRequestBodyPost()
|
||||||
|
.setType(create.getType().getKey())
|
||||||
|
.setModules(create.getModules().stream()
|
||||||
|
.map(module -> new MgmtSoftwareModuleAssignment().setId(module.getId()))
|
||||||
|
.map(MgmtSoftwareModuleAssignment.class::cast)
|
||||||
|
.toList())
|
||||||
|
.setName(create.getName())
|
||||||
|
.setDescription(create.getDescription())
|
||||||
|
.setVersion(create.getVersion())
|
||||||
|
.setRequiredMigrationStep(create.getRequiredMigrationStep()))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
private JSONArray createTargetAndJsonArray(final String schedule, final String duration, final String timezone,
|
private JSONArray createTargetAndJsonArray(final String schedule, final String duration, final String timezone,
|
||||||
final String type, final Boolean confirmationRequired, final String... targetIds) throws Exception {
|
final String type, final Boolean confirmationRequired, final String... targetIds) throws Exception {
|
||||||
final JSONArray result = new JSONArray();
|
final JSONArray result = new JSONArray();
|
||||||
@@ -1927,22 +1943,6 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe
|
|||||||
.andReturn();
|
.andReturn();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<MgmtDistributionSetRequestBodyPut> toMgmtDistributionSetPost(final List<DistributionSetManagement.Create> creates) {
|
|
||||||
return creates.stream()
|
|
||||||
.map(create ->
|
|
||||||
new MgmtDistributionSetRequestBodyPost()
|
|
||||||
.setType(create.getType().getKey())
|
|
||||||
.setModules(create.getModules().stream()
|
|
||||||
.map(module -> new MgmtSoftwareModuleAssignment().setId(module.getId()))
|
|
||||||
.map(MgmtSoftwareModuleAssignment.class::cast)
|
|
||||||
.toList())
|
|
||||||
.setName(create.getName())
|
|
||||||
.setDescription(create.getDescription())
|
|
||||||
.setVersion(create.getVersion())
|
|
||||||
.setRequiredMigrationStep(create.getRequiredMigrationStep()))
|
|
||||||
.toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private Set<DistributionSet> createDistributionSetsAlphabetical(final int amount) {
|
private Set<DistributionSet> createDistributionSetsAlphabetical(final int amount) {
|
||||||
char character = 'a';
|
char character = 'a';
|
||||||
final Set<DistributionSet> created = new HashSet<>(amount);
|
final Set<DistributionSet> created = new HashSet<>(amount);
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio
|
|||||||
final Map<String, Object> info = exceptionInfo.getInfo();
|
final Map<String, Object> info = exceptionInfo.getInfo();
|
||||||
assertThat(info).isNotNull();
|
assertThat(info).isNotNull();
|
||||||
assertThat(info.get(EntityNotFoundException.TYPE)).isEqualTo(DistributionSet.class.getSimpleName());
|
assertThat(info.get(EntityNotFoundException.TYPE)).isEqualTo(DistributionSet.class.getSimpleName());
|
||||||
final List<String> notFound = (List<String>)info.get(EntityNotFoundException.ENTITY_ID);
|
final List<String> notFound = (List<String>) info.get(EntityNotFoundException.ENTITY_ID);
|
||||||
Collections.sort(notFound);
|
Collections.sort(notFound);
|
||||||
assertThat(notFound).isEqualTo(missing);
|
assertThat(notFound).isEqualTo(missing);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,10 +25,8 @@ import org.hamcrest.Matchers;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
|
|
||||||
|
|
||||||
public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegrationTest {
|
public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegrationTest {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldRetrieveDistinctTargetGroups() throws Exception {
|
void shouldRetrieveDistinctTargetGroups() throws Exception {
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegratio
|
|||||||
targetManagement.create(builder().controllerId("target3").group("Europe").build());
|
targetManagement.create(builder().controllerId("target3").group("Europe").build());
|
||||||
|
|
||||||
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING)
|
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING)
|
||||||
.contentType(MediaType.APPLICATION_JSON))
|
.contentType(MediaType.APPLICATION_JSON))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$.[0]", Matchers.in(expectedGroups)))
|
.andExpect(jsonPath("$.[0]", Matchers.in(expectedGroups)))
|
||||||
.andExpect(jsonPath("$.[1]", Matchers.in(expectedGroups)));
|
.andExpect(jsonPath("$.[1]", Matchers.in(expectedGroups)));
|
||||||
@@ -51,8 +49,8 @@ public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegratio
|
|||||||
targetManagement.create(builder().controllerId("target3").group("Europe").build());
|
targetManagement.create(builder().controllerId("target3").group("Europe").build());
|
||||||
|
|
||||||
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
||||||
.param("group", "Europe/East")
|
.param("group", "Europe/East")
|
||||||
.param("subgroups", "false"))
|
.param("subgroups", "false"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("content", Matchers.hasSize(1)))
|
.andExpect(jsonPath("content", Matchers.hasSize(1)))
|
||||||
.andExpect(jsonPath("content.[0].controllerId", Matchers.equalTo("target2")));
|
.andExpect(jsonPath("content.[0].controllerId", Matchers.equalTo("target2")));
|
||||||
@@ -93,7 +91,6 @@ public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegratio
|
|||||||
.content(toJson(Arrays.asList("target1", "target2", "target3"))))
|
.content(toJson(Arrays.asList("target1", "target2", "target3"))))
|
||||||
.andExpect(status().isNoContent());
|
.andExpect(status().isNoContent());
|
||||||
|
|
||||||
|
|
||||||
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/newGroup/assigned")
|
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/newGroup/assigned")
|
||||||
.param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")
|
.param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")
|
||||||
.contentType(MediaType.APPLICATION_JSON))
|
.contentType(MediaType.APPLICATION_JSON))
|
||||||
@@ -169,8 +166,8 @@ public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegratio
|
|||||||
targetManagement.create(builder().controllerId("target2").group("Europe").build());
|
targetManagement.create(builder().controllerId("target2").group("Europe").build());
|
||||||
|
|
||||||
mvc.perform(delete(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
mvc.perform(delete(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.content(toJson(Arrays.asList("target1", "target2"))))
|
.content(toJson(Arrays.asList("target1", "target2"))))
|
||||||
.andExpect(status().isNoContent());
|
.andExpect(status().isNoContent());
|
||||||
|
|
||||||
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
mvc.perform(get(MgmtRestConstants.TARGET_GROUP_V1_REQUEST_MAPPING + "/assigned")
|
||||||
@@ -230,7 +227,5 @@ public class MgmtTargetGroupResourceTest extends AbstractManagementApiIntegratio
|
|||||||
.andExpect(jsonPath("content.[0].controllerId", Matchers.equalTo("target1")))
|
.andExpect(jsonPath("content.[0].controllerId", Matchers.equalTo("target1")))
|
||||||
.andExpect(jsonPath("content.[1].controllerId", Matchers.equalTo("target2")))
|
.andExpect(jsonPath("content.[1].controllerId", Matchers.equalTo("target2")))
|
||||||
.andExpect(jsonPath("content.[2].controllerId", Matchers.equalTo("target3")));
|
.andExpect(jsonPath("content.[2].controllerId", Matchers.equalTo("target3")));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2571,32 +2571,32 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest {
|
|||||||
testdataFactory.createTargetType("targettype", Set.of());
|
testdataFactory.createTargetType("targettype", Set.of());
|
||||||
|
|
||||||
// GET is not allowed
|
// GET is not allowed
|
||||||
mvc.perform(get(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING, knownTargetId))
|
mvc.perform(get(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE, knownTargetId))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isMethodNotAllowed());
|
.andExpect(status().isMethodNotAllowed());
|
||||||
|
|
||||||
// PUT is not allowed
|
// PUT is not allowed
|
||||||
mvc.perform(put(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING, knownTargetId))
|
mvc.perform(put(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE, knownTargetId))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isMethodNotAllowed());
|
.andExpect(status().isMethodNotAllowed());
|
||||||
|
|
||||||
// POST does not exist with path parameter targettype
|
// POST does not exist with path parameter targettype
|
||||||
mvc.perform(post(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING + "/123", knownTargetId))
|
mvc.perform(post(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE + "/123", knownTargetId))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isNotFound());
|
.andExpect(status().isNotFound());
|
||||||
|
|
||||||
// DELETE does not exist with path parameter targettype
|
// DELETE does not exist with path parameter targettype
|
||||||
mvc.perform(delete(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING + "/123", knownTargetId))
|
mvc.perform(delete(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE + "/123", knownTargetId))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isNotFound());
|
.andExpect(status().isNotFound());
|
||||||
|
|
||||||
// Invalid content
|
// Invalid content
|
||||||
mvc.perform(post(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING, knownTargetId))
|
mvc.perform(post(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE, knownTargetId))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isUnsupportedMediaType());
|
.andExpect(status().isUnsupportedMediaType());
|
||||||
|
|
||||||
// Bad request if id field is missing
|
// Bad request if id field is missing
|
||||||
mvc.perform(post(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING, knownTargetId)
|
mvc.perform(post(TARGET_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TARGET_ID_TARGETTYPE, knownTargetId)
|
||||||
.content("{\"unknownfield\":123}").contentType(APPLICATION_JSON))
|
.content("{\"unknownfield\":123}").contentType(APPLICATION_JSON))
|
||||||
.andDo(MockMvcResultPrinter.print())
|
.andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isBadRequest());
|
.andExpect(status().isBadRequest());
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest {
|
|||||||
|
|
||||||
private static final String TARGETTYPES_ENDPOINT = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING;
|
private static final String TARGETTYPES_ENDPOINT = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING;
|
||||||
private static final String TARGETTYPE_SINGLE_ENDPOINT = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{typeid}";
|
private static final String TARGETTYPE_SINGLE_ENDPOINT = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{typeid}";
|
||||||
private static final String TARGETTYPE_DSTYPES_ENDPOINT = TARGETTYPE_SINGLE_ENDPOINT + "/" + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES;
|
private static final String TARGETTYPE_DSTYPES_ENDPOINT = TARGETTYPE_SINGLE_ENDPOINT + "/" + MgmtRestConstants.COMPATIBLEDISTRIBUTIONSETTYPES;
|
||||||
private static final String TARGETTYPE_DSTYPE_SINGLE_ENDPOINT = TARGETTYPE_DSTYPES_ENDPOINT + "/{dstypeid}";
|
private static final String TARGETTYPE_DSTYPE_SINGLE_ENDPOINT = TARGETTYPE_DSTYPES_ENDPOINT + "/{dstypeid}";
|
||||||
|
|
||||||
private static final String TEST_USER = "targetTypeTester";
|
private static final String TEST_USER = "targetTypeTester";
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class SortUtilityTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorting based on name with case sensitive is possible.
|
* Sorting based on name with case-sensitive is possible.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("squid:S2699") // assert no error
|
@SuppressWarnings("squid:S2699") // assert no error
|
||||||
|
|||||||
@@ -25,26 +25,31 @@ public class OidcProperties {
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Oauth2 {
|
public static class Oauth2 {
|
||||||
|
|
||||||
private final OidcProperties.Oauth2.ResourceServer resourceserver = new OidcProperties.Oauth2.ResourceServer();
|
private final OidcProperties.Oauth2.ResourceServer resourceserver = new OidcProperties.Oauth2.ResourceServer();
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class ResourceServer {
|
public static class ResourceServer {
|
||||||
|
|
||||||
private final OidcProperties.Oauth2.ResourceServer.Jwt jwt = new OidcProperties.Oauth2.ResourceServer.Jwt();
|
private final OidcProperties.Oauth2.ResourceServer.Jwt jwt = new OidcProperties.Oauth2.ResourceServer.Jwt();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the default OAuth2 resource server configuration is enabled.
|
* Indicates whether the default OAuth2 resource server configuration is enabled.
|
||||||
* Defaults to false. If false either no Oauth2 resource server is active or a hawkbitOAuth2ResourceServerCustomizer component can be used to define custom OAuth2 resource server behaviour.
|
* Defaults to false. If false either no Oauth2 resource server is active or a hawkbitOAuth2ResourceServerCustomizer component can be used to define custom OAuth2 resource server behaviour.
|
||||||
* If true, the default spring OAuth2 resource server configuration is activated.
|
* If true, the default spring OAuth2 resource server configuration is activated.
|
||||||
|
*
|
||||||
* @see <a href="https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/jwt.html#_specifying_the_authorization_server">Spring Documentation</a>
|
* @see <a href="https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/jwt.html#_specifying_the_authorization_server">Spring Documentation</a>
|
||||||
*/
|
*/
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Jwt {
|
public static class Jwt {
|
||||||
|
|
||||||
private final OidcProperties.Oauth2.ResourceServer.Jwt.Claim claim = new OidcProperties.Oauth2.ResourceServer.Jwt.Claim();
|
private final OidcProperties.Oauth2.ResourceServer.Jwt.Claim claim = new OidcProperties.Oauth2.ResourceServer.Jwt.Claim();
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Claim {
|
public static class Claim {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the claim within the JWT token that supplies the hawkbit username.
|
* Defines the claim within the JWT token that supplies the hawkbit username.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -167,8 +167,8 @@ public final class RolloutHelper {
|
|||||||
* @param group the target group
|
* @param group the target group
|
||||||
* @return RSQL string without base filter of the Rollout. Can be an empty string.
|
* @return RSQL string without base filter of the Rollout. Can be an empty string.
|
||||||
*/
|
*/
|
||||||
public static String getOverlappingWithGroupsTargetFilter(final String baseFilter, final List<RolloutGroup> groups,
|
public static String getOverlappingWithGroupsTargetFilter(
|
||||||
final RolloutGroup group) {
|
final String baseFilter, final List<RolloutGroup> groups, final RolloutGroup group) {
|
||||||
final String groupFilter = group.getTargetFilterQuery();
|
final String groupFilter = group.getTargetFilterQuery();
|
||||||
// when any previous group has the same filter as the target group the
|
// when any previous group has the same filter as the target group the
|
||||||
// overlap is 100%
|
// overlap is 100%
|
||||||
@@ -248,8 +248,7 @@ public final class RolloutHelper {
|
|||||||
|
|
||||||
private static boolean isTargetFilterInGroups(final String groupFilter, final List<RolloutGroup> groups) {
|
private static boolean isTargetFilterInGroups(final String groupFilter, final List<RolloutGroup> groups) {
|
||||||
return !ObjectUtils.isEmpty(groupFilter)
|
return !ObjectUtils.isEmpty(groupFilter)
|
||||||
&& groups.stream().anyMatch(prevGroup -> !ObjectUtils.isEmpty(prevGroup.getTargetFilterQuery())
|
&& groups.stream().anyMatch(group -> groupFilter.equals(group.getTargetFilterQuery()));
|
||||||
&& prevGroup.getTargetFilterQuery().equals(groupFilter));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String concatAndTargetFilters(final String... filters) {
|
private static String concatAndTargetFilters(final String... filters) {
|
||||||
|
|||||||
@@ -376,8 +376,9 @@ public class JpaRolloutManagement implements RolloutManagement {
|
|||||||
/**
|
/**
|
||||||
* Check if on resume of a paused rollout the next group shall be started directly.
|
* Check if on resume of a paused rollout the next group shall be started directly.
|
||||||
* Cases where we need to manually start the next group:
|
* Cases where we need to manually start the next group:
|
||||||
* - last running group is in error state and there is still some old group in running state, only running groups would be evaluated which would leave Rollout in running state but no trigger new group
|
* - last running group is in error state and there is still some old group in running state, only running groups would be evaluated which would leave Rollout in running state but no trigger new group
|
||||||
* - last running group has success action to PAUSE and the success condition is fulfilled
|
* - last running group has success action to PAUSE and the success condition is fulfilled
|
||||||
|
*
|
||||||
* @param rollout
|
* @param rollout
|
||||||
* @param lastStartedGroup
|
* @param lastStartedGroup
|
||||||
* @return true if next group shall be started directly on resume, false otherwise
|
* @return true if next group shall be started directly on resume, false otherwise
|
||||||
@@ -964,8 +965,7 @@ public class JpaRolloutManagement implements RolloutManagement {
|
|||||||
RolloutHelper.verifyRolloutGroupTargetPercentage(group.getTargetPercentage());
|
RolloutHelper.verifyRolloutGroupTargetPercentage(group.getTargetPercentage());
|
||||||
|
|
||||||
final long targetsInGroupFilter = targetFilterCounts.get(groupTargetFilter);
|
final long targetsInGroupFilter = targetFilterCounts.get(groupTargetFilter);
|
||||||
final long overlappingTargets = countOverlappingTargetsWithPreviousGroups(baseFilter, groups, group, i,
|
final long overlappingTargets = countOverlappingTargetsWithPreviousGroups(baseFilter, groups, group, i, targetFilterCounts);
|
||||||
targetFilterCounts);
|
|
||||||
|
|
||||||
final long realTargetsInGroup;
|
final long realTargetsInGroup;
|
||||||
// Assume that targets which were not used in the previous groups
|
// Assume that targets which were not used in the previous groups
|
||||||
@@ -995,8 +995,7 @@ public class JpaRolloutManagement implements RolloutManagement {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
final List<RolloutGroup> previousGroups = groups.subList(0, groupIndex);
|
final List<RolloutGroup> previousGroups = groups.subList(0, groupIndex);
|
||||||
final String overlappingTargetsFilter = RolloutHelper.getOverlappingWithGroupsTargetFilter(baseFilter,
|
final String overlappingTargetsFilter = RolloutHelper.getOverlappingWithGroupsTargetFilter(baseFilter, previousGroups, group);
|
||||||
previousGroups, group);
|
|
||||||
|
|
||||||
if (targetFilterCounts.containsKey(overlappingTargetsFilter)) {
|
if (targetFilterCounts.containsKey(overlappingTargetsFilter)) {
|
||||||
return targetFilterCounts.get(overlappingTargetsFilter);
|
return targetFilterCounts.get(overlappingTargetsFilter);
|
||||||
@@ -1007,8 +1006,8 @@ public class JpaRolloutManagement implements RolloutManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long calculateRemainingTargets(final List<RolloutGroup> groups, final String targetFilter, final Long createdAt,
|
private long calculateRemainingTargets(
|
||||||
final Long dsTypeId) {
|
final List<RolloutGroup> groups, final String targetFilter, final Long createdAt, final Long dsTypeId) {
|
||||||
final TargetCount targets = calculateTargets(targetFilter, createdAt, dsTypeId);
|
final TargetCount targets = calculateTargets(targetFilter, createdAt, dsTypeId);
|
||||||
|
|
||||||
final long totalTargets = targets.total();
|
final long totalTargets = targets.total();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.util.Optional;
|
|||||||
|
|
||||||
import jakarta.persistence.CascadeType;
|
import jakarta.persistence.CascadeType;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.ConstraintMode;
|
|
||||||
import jakarta.persistence.Convert;
|
import jakarta.persistence.Convert;
|
||||||
import jakarta.persistence.Converter;
|
import jakarta.persistence.Converter;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ public class JpaRolloutGroup extends AbstractJpaNamedEntity implements RolloutGr
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(
|
@JoinColumn(name = "rollout", nullable = false, updatable = false)
|
||||||
name = "rollout", nullable = false, updatable = false)
|
|
||||||
private JpaRollout rollout;
|
private JpaRollout rollout;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@@ -63,9 +62,8 @@ public class JpaRolloutGroup extends AbstractJpaNamedEntity implements RolloutGr
|
|||||||
@Convert(converter = RolloutGroupStatusConverter.class)
|
@Convert(converter = RolloutGroupStatusConverter.class)
|
||||||
private RolloutGroupStatus status = RolloutGroupStatus.CREATING;
|
private RolloutGroupStatus status = RolloutGroupStatus.CREATING;
|
||||||
|
|
||||||
@OneToMany(
|
@OneToMany(targetEntity = RolloutTargetGroup.class, mappedBy = "rolloutGroup",
|
||||||
mappedBy = "rolloutGroup", fetch = FetchType.LAZY,
|
fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REMOVE })
|
||||||
cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, targetEntity = RolloutTargetGroup.class)
|
|
||||||
private List<RolloutTargetGroup> rolloutTargetGroup;
|
private List<RolloutTargetGroup> rolloutTargetGroup;
|
||||||
|
|
||||||
// No foreign key to avoid to many nested cascades on delete which some DBs cannot handle
|
// No foreign key to avoid to many nested cascades on delete which some DBs cannot handle
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import static org.eclipse.hawkbit.repository.jpa.executor.AfterTransactionCommit
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions;
|
|
||||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
|
|||||||
@@ -0,0 +1,236 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
||||||
|
*
|
||||||
|
* This program and the accompanying materials are made
|
||||||
|
* available under the terms of the Eclipse Public License 2.0
|
||||||
|
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: EPL-2.0
|
||||||
|
*/
|
||||||
|
package org.eclipse.hawkbit.rest;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Standard API response annotations for REST endpoints. <br/>
|
||||||
|
* Contains composed annotations for different HTTP method types:
|
||||||
|
* <ul>
|
||||||
|
* <li>POST - for create and update, </li>
|
||||||
|
* <li>GET - with 404 on not exist or 200 on not exist (if exist)</li>
|
||||||
|
* <li>PUT - with 200 and 204 (NoContent) flavours </li>
|
||||||
|
* <li>DELETE</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
|
||||||
|
public final class ApiResponsesConstants {
|
||||||
|
|
||||||
|
// Response Codes
|
||||||
|
private static final String OK_200 = "200";
|
||||||
|
private static final String CREATED_201 = "201";
|
||||||
|
private static final String NO_CONTENT_204 = "204";
|
||||||
|
private static final String BAD_REQUEST_400 = "400";
|
||||||
|
private static final String UNAUTHORIZED_401 = "401";
|
||||||
|
private static final String FORBIDDEN_403 = "403";
|
||||||
|
private static final String NOT_FOUND_404 = "404";
|
||||||
|
private static final String METHOD_NOT_ALLOWED_405 = "405";
|
||||||
|
private static final String NOT_ACCEPTABLE_406 = "406";
|
||||||
|
private static final String CONFLICT_409 = "409";
|
||||||
|
private static final String UNSUPPORTED_MEDIA_TYPE_415 = "415";
|
||||||
|
private static final String TOO_MANY_REQUESTS_429 = "429";
|
||||||
|
|
||||||
|
// Success Descriptions
|
||||||
|
private static final String DESC_SUCCESS_CREATED = "Successfully created";
|
||||||
|
private static final String DESC_SUCCESS_RETRIEVED = "Successfully retrieved";
|
||||||
|
private static final String DESC_SUCCESS_UPDATED = "Successfully updated";
|
||||||
|
private static final String DESC_SUCCESS_DELETED = "Successfully deleted";
|
||||||
|
|
||||||
|
// Error Descriptions
|
||||||
|
private static final String DESC_BAD_REQUEST = "Bad Request - e.g. invalid parameters";
|
||||||
|
private static final String DESC_UNAUTHORIZED = "The request requires user auth.";
|
||||||
|
private static final String DESC_FORBIDDEN = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.";
|
||||||
|
private static final String DESC_NOT_FOUND = "Requested resource not found.";
|
||||||
|
private static final String DESC_REC_OR_REF_NOT_FOUND = "Requested (or referenced) resource not found.";
|
||||||
|
private static final String DESC_METHOD_NOT_ALLOWED = "The http request method is not allowed on the resource.";
|
||||||
|
private static final String DESC_NOT_ACCEPTABLE = "In case accept header is specified and not application/json.";
|
||||||
|
private static final String DESC_CONFLICT = "E.g. in case an entity is created or modified by another user in another request at the same time. You may retry your modification request.";
|
||||||
|
private static final String DESC_UNSUPPORTED_MEDIA_TYPE = "The request was attempt with a media-type which is not supported by the server for this resource.";
|
||||||
|
private static final String DESC_TOO_MANY_REQUESTS = "Too many requests. The server will refuse further attempts and the client has to wait another second.";
|
||||||
|
|
||||||
|
// Media Types
|
||||||
|
private static final String MEDIA_TYPE_JSON = "application/json";
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = CREATED_201, description = DESC_SUCCESS_CREATED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = CONFLICT_409,
|
||||||
|
description = DESC_CONFLICT,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = UNSUPPORTED_MEDIA_TYPE_415,
|
||||||
|
description = DESC_UNSUPPORTED_MEDIA_TYPE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface PostCreateResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = OK_200, description = DESC_SUCCESS_UPDATED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_FOUND_404, description = DESC_REC_OR_REF_NOT_FOUND,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = CONFLICT_409, description = DESC_CONFLICT,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = UNSUPPORTED_MEDIA_TYPE_415,
|
||||||
|
description = DESC_UNSUPPORTED_MEDIA_TYPE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface PostUpdateResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = NO_CONTENT_204, description = DESC_SUCCESS_UPDATED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = CONFLICT_409,
|
||||||
|
description = DESC_CONFLICT,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(responseCode = UNSUPPORTED_MEDIA_TYPE_415, description = DESC_UNSUPPORTED_MEDIA_TYPE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface PostCreateNoContentResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = NO_CONTENT_204, description = DESC_SUCCESS_UPDATED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_FOUND_404, description = DESC_REC_OR_REF_NOT_FOUND,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(responseCode = UNSUPPORTED_MEDIA_TYPE_415, description = DESC_UNSUPPORTED_MEDIA_TYPE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface PostUpdateNoContentResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = OK_200, description = DESC_SUCCESS_RETRIEVED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_FOUND_404, description = DESC_NOT_FOUND,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface GetResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = OK_200, description = DESC_SUCCESS_RETRIEVED)
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface GetIfExistResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = OK_200, description = DESC_SUCCESS_UPDATED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_FOUND_404, description = DESC_REC_OR_REF_NOT_FOUND,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = CONFLICT_409,
|
||||||
|
description = DESC_CONFLICT,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = UNSUPPORTED_MEDIA_TYPE_415,
|
||||||
|
description = DESC_UNSUPPORTED_MEDIA_TYPE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface PutResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = NO_CONTENT_204, description = DESC_SUCCESS_UPDATED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_FOUND_404, description = DESC_REC_OR_REF_NOT_FOUND,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = CONFLICT_409,
|
||||||
|
description = DESC_CONFLICT,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = UNSUPPORTED_MEDIA_TYPE_415,
|
||||||
|
description = DESC_UNSUPPORTED_MEDIA_TYPE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface PutNoContentResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = NO_CONTENT_204, description = DESC_SUCCESS_DELETED),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_FOUND_404, description = DESC_NOT_FOUND,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
@CommonErrorResponses
|
||||||
|
public @interface DeleteResponses {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = BAD_REQUEST_400, description = DESC_BAD_REQUEST,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(implementation = ExceptionInfo.class))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = UNAUTHORIZED_401, description = DESC_UNAUTHORIZED,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = FORBIDDEN_403,
|
||||||
|
description = DESC_FORBIDDEN,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = METHOD_NOT_ALLOWED_405, description = DESC_METHOD_NOT_ALLOWED,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = NOT_ACCEPTABLE_406, description = DESC_NOT_ACCEPTABLE,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true))),
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = TOO_MANY_REQUESTS_429,
|
||||||
|
description = DESC_TOO_MANY_REQUESTS,
|
||||||
|
content = @Content(mediaType = MEDIA_TYPE_JSON, schema = @Schema(hidden = true)))
|
||||||
|
})
|
||||||
|
private @interface CommonErrorResponses {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,10 +26,10 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.eclipse.hawkbit.exception.AbstractServerRtException;
|
import org.eclipse.hawkbit.exception.AbstractServerRtException;
|
||||||
import org.eclipse.hawkbit.exception.SpServerError;
|
import org.eclipse.hawkbit.exception.SpServerError;
|
||||||
|
import org.eclipse.hawkbit.rest.exception.FileStreamingFailedException;
|
||||||
import org.eclipse.hawkbit.rest.exception.MessageNotReadableException;
|
import org.eclipse.hawkbit.rest.exception.MessageNotReadableException;
|
||||||
import org.eclipse.hawkbit.rest.exception.MultiPartFileUploadException;
|
import org.eclipse.hawkbit.rest.exception.MultiPartFileUploadException;
|
||||||
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
|
||||||
import org.eclipse.hawkbit.rest.exception.FileStreamingFailedException;
|
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|||||||
Reference in New Issue
Block a user