REST doc / Mgmt Target Filters - fix missed info (#1627)
When spring restdoc was replaces with swagger & open api some info was lost This commit returns back this info for Mgmt API - TargetFilters Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -31,35 +31,100 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@JsonInclude(Include.NON_NULL)
|
@JsonInclude(Include.NON_NULL)
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@Schema(example = """
|
@Schema(description = """
|
||||||
|
**_links**:
|
||||||
|
* **type** - The type of the distribution set
|
||||||
|
* **modules** - List of software modules
|
||||||
|
* **metadata** - List of metadata
|
||||||
|
""", example = """
|
||||||
{
|
{
|
||||||
"createdBy" : "bumlux",
|
"createdBy" : "bumlux",
|
||||||
"createdAt" : 1682408575642,
|
"createdAt" : 1682408574924,
|
||||||
"lastModifiedBy" : "bumlux",
|
"lastModifiedBy" : "bumlux",
|
||||||
"lastModifiedAt" : 1682408575643,
|
"lastModifiedAt" : 1682408574925,
|
||||||
"name" : "DS",
|
"name" : "DS",
|
||||||
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
|
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
|
||||||
"version" : "1.0",
|
"version" : "1.0",
|
||||||
"modules" : [ {
|
"modules" : [ {
|
||||||
"createdBy" : "bumlux",
|
"createdBy" : "bumlux",
|
||||||
"createdAt" : 1682408575640,
|
"createdAt" : 1682408574921,
|
||||||
"lastModifiedBy" : "bumlux",
|
"lastModifiedBy" : "bumlux",
|
||||||
"lastModifiedAt" : 1682408575644,
|
"lastModifiedAt" : 1682408574926,
|
||||||
"name" : "Firmware",
|
"name" : "Firmware",
|
||||||
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
|
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
|
||||||
"version" : "1.0.5",
|
"version" : "1.0.42",
|
||||||
"type" : "os",
|
"type" : "os",
|
||||||
"typeName" : "OS",
|
"typeName" : "OS",
|
||||||
"vendor" : "vendor Limited Inc, California",
|
"vendor" : "vendor Limited Inc, California",
|
||||||
"deleted" : false,
|
"deleted" : false,
|
||||||
"encrypted" : false,
|
"encrypted" : false,
|
||||||
"_links" : {
|
"_links" : {
|
||||||
"self" : {
|
"self" : {
|
||||||
"href" : "https://management-api.host.com/rest/v1/softwaremodules/76"
|
"href" : "https://management-api.host.com/rest/v1/softwaremodules/18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"id" : 76
|
"id" : 18
|
||||||
}""")
|
}, {
|
||||||
|
"createdBy" : "bumlux",
|
||||||
|
"createdAt" : 1682408574920,
|
||||||
|
"lastModifiedBy" : "bumlux",
|
||||||
|
"lastModifiedAt" : 1682408574925,
|
||||||
|
"name" : "app runtime",
|
||||||
|
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
|
||||||
|
"version" : "1.0.25",
|
||||||
|
"type" : "runtime",
|
||||||
|
"typeName" : "runtime",
|
||||||
|
"vendor" : "vendor GmbH, Stuttgart, Germany",
|
||||||
|
"deleted" : false,
|
||||||
|
"encrypted" : false,
|
||||||
|
"_links" : {
|
||||||
|
"self" : {
|
||||||
|
"href" : "https://management-api.host.com/rest/v1/softwaremodules/17"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id" : 17
|
||||||
|
}, {
|
||||||
|
"createdBy" : "bumlux",
|
||||||
|
"createdAt" : 1682408574919,
|
||||||
|
"lastModifiedBy" : "bumlux",
|
||||||
|
"lastModifiedAt" : 1682408574926,
|
||||||
|
"name" : "application",
|
||||||
|
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
|
||||||
|
"version" : "1.0.67",
|
||||||
|
"type" : "application",
|
||||||
|
"typeName" : "Application",
|
||||||
|
"vendor" : "vendor Limited, California",
|
||||||
|
"deleted" : false,
|
||||||
|
"encrypted" : false,
|
||||||
|
"_links" : {
|
||||||
|
"self" : {
|
||||||
|
"href" : "https://management-api.host.com/rest/v1/softwaremodules/16"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id" : 16
|
||||||
|
} ],
|
||||||
|
"requiredMigrationStep" : false,
|
||||||
|
"type" : "test_default_ds_type",
|
||||||
|
"typeName" : "OS (FW) mandatory, runtime (FW) and app (SW) optional",
|
||||||
|
"complete" : true,
|
||||||
|
"deleted" : false,
|
||||||
|
"valid" : true,
|
||||||
|
"_links" : {
|
||||||
|
"self" : {
|
||||||
|
"href" : "https://management-api.host.com/rest/v1/distributionsets/6"
|
||||||
|
},
|
||||||
|
"modules" : {
|
||||||
|
"href" : "https://management-api.host.com/rest/v1/distributionsets/6/assignedSM?offset=0&limit=50"
|
||||||
|
},
|
||||||
|
"type" : {
|
||||||
|
"href" : "https://management-api.host.com/rest/v1/distributionsettypes/24"
|
||||||
|
},
|
||||||
|
"metadata" : {
|
||||||
|
"href" : "https://management-api.host.com/rest/v1/distributionsets/6/metadata?offset=0&limit=50"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id" : 6
|
||||||
|
}""")
|
||||||
public class MgmtDistributionSet extends MgmtNamedEntity {
|
public class MgmtDistributionSet extends MgmtNamedEntity {
|
||||||
|
|
||||||
@JsonProperty(value = "id", required = true)
|
@JsonProperty(value = "id", required = true)
|
||||||
|
|||||||
@@ -27,52 +27,59 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@JsonInclude(Include.ALWAYS)
|
@JsonInclude(Include.ALWAYS)
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@Schema(example = """
|
@Schema(description = """
|
||||||
|
**_links**:
|
||||||
|
* **autoAssignDS** - Link to manage the auto assign distribution set
|
||||||
|
""", example = """
|
||||||
{
|
{
|
||||||
"createdBy" : "bumlux",
|
"createdBy" : "bumlux",
|
||||||
"createdAt" : 1682408575234,
|
"createdAt" : 1682408566380,
|
||||||
"lastModifiedBy" : "bumlux",
|
"lastModifiedBy" : "bumlux",
|
||||||
"lastModifiedAt" : 1682408575234,
|
"lastModifiedAt" : 1682408566385,
|
||||||
"name" : "filter1",
|
"name" : "filter1",
|
||||||
"query" : "name==a",
|
"query" : "name==*",
|
||||||
"autoAssignDistributionSet" : 16,
|
"autoAssignDistributionSet" : 3,
|
||||||
"autoAssignActionType" : null,
|
"autoAssignActionType" : "forced",
|
||||||
"autoAssignWeight" : null,
|
"autoAssignWeight" : null,
|
||||||
"confirmationRequired" : null,
|
"confirmationRequired" : null,
|
||||||
"_links" : {
|
"_links" : {
|
||||||
"self" : {
|
"self" : {
|
||||||
"href" : "https://management-api.host.com/rest/v1/targetfilters/2"
|
"href" : "https://management-api.host.com/rest/v1/targetfilters/5"
|
||||||
}
|
},
|
||||||
},
|
"autoAssignDS" : {
|
||||||
"id" : 2
|
"href" : "https://management-api.host.com/rest/v1/targetfilters/5/autoAssignDS"
|
||||||
}""")
|
}
|
||||||
|
},
|
||||||
|
"id" : 5
|
||||||
|
}""")
|
||||||
public class MgmtTargetFilterQuery extends MgmtBaseEntity {
|
public class MgmtTargetFilterQuery extends MgmtBaseEntity {
|
||||||
|
|
||||||
@JsonProperty(value = "id", required = true)
|
@JsonProperty(value = "id", required = true)
|
||||||
@Schema(example = "2")
|
@Schema(description = "The technical identifier of the entity", example = "2")
|
||||||
private Long filterId;
|
private Long filterId;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@Schema(example = "filterName")
|
@Schema(description = "The name of the entity", example = "filterName")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@Schema(example = "name==*")
|
@Schema(description = "Target filter query expression", example = "name==*")
|
||||||
private String query;
|
private String query;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@Schema(example = "15")
|
@Schema(example = "15")
|
||||||
|
|
||||||
private Long autoAssignDistributionSet;
|
private Long autoAssignDistributionSet;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
|
@Schema(description = "Auto assign distribution set id")
|
||||||
private MgmtActionType autoAssignActionType;
|
private MgmtActionType autoAssignActionType;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@Schema(example = "")
|
@Schema(description = "Weight of the resulting Actions", example = "600")
|
||||||
private Integer autoAssignWeight;
|
private Integer autoAssignWeight;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@Schema(example = "false")
|
@Schema(description = "(Available with user consent flow active) Defines, if the confirmation is required for an " +
|
||||||
|
"action. Confirmation is required per default.", example = "false")
|
||||||
private Boolean confirmationRequired;
|
private Boolean confirmationRequired;
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,8 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* @return a single target with status OK.
|
* @return a single target with status OK.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Operation(summary = "Return target filter query by id", description = "Handles the GET request of retrieving a single target filter query. Required permission: READ_TARGET")
|
@Operation(summary = "Return target filter query by id", description = "Handles the GET request of retrieving a " +
|
||||||
|
"single target filter query. Required permission: READ_TARGET")
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
||||||
@@ -58,7 +59,8 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
||||||
"data volume restriction applies.",
|
"data volume restriction applies.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
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 = "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.",
|
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
||||||
@@ -299,7 +301,9 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* assignment
|
* assignment
|
||||||
* @return http status
|
* @return http status
|
||||||
*/
|
*/
|
||||||
@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 query. Required permissions: UPDATE_TARGET and READ_REPOSITORY")
|
@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 " +
|
||||||
|
"query. Required permissions: UPDATE_TARGET and READ_REPOSITORY")
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
||||||
@@ -310,7 +314,8 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
||||||
"data volume restriction applies.",
|
"data volume restriction applies.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
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 = "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.",
|
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
||||||
@@ -339,7 +344,9 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
* of the target to change
|
* of the target to change
|
||||||
* @return http status
|
* @return http status
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Remove Distribution Set for auto assignment of a target filter", description = "Removes the auto assign distribution set from the target filter query. Required permission: UPDATE_TARGET")
|
@Operation(summary = "Remove Distribution Set for auto assignment of a target filter",
|
||||||
|
description = "Removes the auto assign distribution set from the target filter query. " +
|
||||||
|
"Required permission: UPDATE_TARGET")
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
@ApiResponse(responseCode = "200", description = "Successfully retrieved"),
|
||||||
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
|
||||||
@@ -350,7 +357,8 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or " +
|
||||||
"data volume restriction applies.",
|
"data volume restriction applies.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
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 = "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.",
|
@ApiResponse(responseCode = "405", description = "The http request method is not allowed on the resource.",
|
||||||
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
|
||||||
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
@ApiResponse(responseCode = "406", description = "In case accept header is specified and not application/json.",
|
||||||
@@ -361,5 +369,4 @@ public interface MgmtTargetFilterQueryRestApi {
|
|||||||
})
|
})
|
||||||
@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);
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user