From c7d936600986efe3ec1dbab7e640025832e5626f Mon Sep 17 00:00:00 2001 From: Diorcet Yann Date: Thu, 1 Aug 2024 10:42:28 +0200 Subject: [PATCH] Replace APiReponse code from 200 to 201 according to behaviour or POST methods (#1796) --- .../hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java | 4 ++-- .../mgmt/rest/api/MgmtDistributionSetTagRestApi.java | 2 +- .../mgmt/rest/api/MgmtDistributionSetTypeRestApi.java | 2 +- .../eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java | 4 ++-- .../hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java | 6 +++--- .../mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java | 2 +- .../hawkbit/mgmt/rest/api/MgmtTargetFilterQueryRestApi.java | 2 +- .../eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java | 4 ++-- .../eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java | 2 +- .../hawkbit/mgmt/rest/api/MgmtTargetTypeRestApi.java | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java index 796b2addb..b644f6459 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java @@ -164,7 +164,7 @@ public interface MgmtDistributionSetRestApi { "distribution sets within Hawkbit. The request body must always be a list of sets. " + "Required permission: CREATE_REPOSITORY") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", @@ -711,7 +711,7 @@ public interface MgmtDistributionSetRestApi { @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") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java index 51f7b375b..3712d363e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java @@ -153,7 +153,7 @@ public interface MgmtDistributionSetTagRestApi { @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.") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java index c8921a806..add9312c3 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java @@ -237,7 +237,7 @@ public interface MgmtDistributionSetTypeRestApi { "new distribution set types. The request body must always be a list of types. " + "Required Permission: CREATE_REPOSITORY") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java index 27e0a4faf..08a1a4b09 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java @@ -157,7 +157,7 @@ public interface MgmtRolloutRestApi { @Operation(summary = "Create a new Rollout", description = "Handles the POST request of creating new rollout. Required Permission: CREATE_ROLLOUT") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", @@ -663,7 +663,7 @@ public interface MgmtRolloutRestApi { @Operation(summary = "Retry a rollout", description = "Handles the POST request of retrying a rollout. " + "Required Permission: CREATE_ROLLOUT") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index 93ac8f3b4..ed56a067e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -63,7 +63,7 @@ public interface MgmtSoftwareModuleRestApi { */ @Operation(summary = "Upload artifact", description = "Handles POST request for artifact upload. Required Permission: CREATE_REPOSITORY") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", @@ -320,7 +320,7 @@ public interface MgmtSoftwareModuleRestApi { */ @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 = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", @@ -611,7 +611,7 @@ public interface MgmtSoftwareModuleRestApi { */ @Operation(summary = "Creates a list of meta data for a specific Software Module", description = "Create a list of meta data entries Required Permission: UPDATE_REPOSITORY") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java index 927ac6553..9212f5a37 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java @@ -238,7 +238,7 @@ public interface MgmtSoftwareModuleTypeRestApi { 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") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetFilterQueryRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetFilterQueryRestApi.java index 84f2fd361..6c6380876 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetFilterQueryRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetFilterQueryRestApi.java @@ -151,7 +151,7 @@ public interface MgmtTargetFilterQueryRestApi { */ @Operation(summary = "Create target filter", description = "Handles the POST request to create a new target filter query. Required permission: CREATE_TARGET") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java index 35f1277dc..3dbe71684 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java @@ -163,7 +163,7 @@ public interface MgmtTargetRestApi { */ @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 = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", @@ -932,7 +932,7 @@ public interface MgmtTargetRestApi { */ @Operation(summary = "Create a list of meta data for a specific target", description = "Create a list of meta data entries Required permissions: READ_REPOSITORY and UPDATE_TARGET") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.", diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java index 1b6eb175a..e146bde47 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java @@ -141,7 +141,7 @@ public interface MgmtTargetTagRestApi { @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.") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication."), diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTypeRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTypeRestApi.java index da105c518..45df3c485 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTypeRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTypeRestApi.java @@ -231,7 +231,7 @@ public interface MgmtTargetTypeRestApi { @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") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Successfully retrieved"), + @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 authentication.",