Code format hawkbit-mgmt-api (#1942)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-05 11:30:46 +02:00
committed by GitHub
parent 0319487525
commit fd933ed61d
65 changed files with 3669 additions and 4068 deletions

View File

@@ -1,10 +1,12 @@
# Eclipse.IoT hawkBit - Management API - Model and Resources # Eclipse.IoT hawkBit - Management API - Model and Resources
This Management (Mgmt) API is used to manage and monitor the HawkBit Update Server via HTTP. This API allows Create/Read/Update/Delete operations for provisioning targets (i.e. devices) and repository content (i.e. software). This Management (Mgmt) API is used to manage and monitor the HawkBit Update Server via HTTP. This API allows
Create/Read/Update/Delete operations for provisioning targets (i.e. devices) and repository content (i.e. software).
# Version 1 # Version 1
The model follows [semantic versioning](http://semver.org) with MAJOR version, i.e. breaking changes will result in a new MAJOR version. The model follows [semantic versioning](http://semver.org) with MAJOR version, i.e. breaking changes will result in a
new MAJOR version.
# Compile # Compile

View File

@@ -9,58 +9,58 @@
SPDX-License-Identifier: EPL-2.0 SPDX-License-Identifier: EPL-2.0
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.eclipse.hawkbit</groupId> <groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-parent</artifactId> <artifactId>hawkbit-rest-parent</artifactId>
<version>${revision}</version> <version>${revision}</version>
</parent> </parent>
<artifactId>hawkbit-mgmt-api</artifactId> <artifactId>hawkbit-mgmt-api</artifactId>
<name>hawkBit :: REST :: Management API</name> <name>hawkBit :: REST :: Management API</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.eclipse.hawkbit</groupId> <groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-core</artifactId> <artifactId>hawkbit-rest-core</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.hateoas</groupId> <groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId> <artifactId>spring-hateoas</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springdoc</groupId> <groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId> <artifactId>spring-boot-starter-json</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>jakarta.validation</groupId> <groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId> <artifactId>jakarta.validation-api</artifactId>
</dependency> </dependency>
<!-- Test --> <!-- Test -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.qameta.allure</groupId> <groupId>io.qameta.allure</groupId>
<artifactId>allure-junit5</artifactId> <artifactId>allure-junit5</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -9,6 +9,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model; package org.eclipse.hawkbit.mgmt.json.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -17,9 +19,6 @@ import lombok.experimental.Accessors;
import org.springframework.hateoas.Link; import org.springframework.hateoas.Link;
import org.springframework.hateoas.RepresentationModel; import org.springframework.hateoas.RepresentationModel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for BaseEntity to RESTful API representation. * A json annotated rest model for BaseEntity to RESTful API representation.
*/ */

View File

@@ -9,22 +9,20 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model; package org.eclipse.hawkbit.mgmt.json.model;
import java.util.Collections;
import java.util.List; import java.util.List;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.hateoas.RepresentationModel;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.hateoas.RepresentationModel;
/** /**
* A list representation with meta data for pagination, e.g. containing the * A list representation with meta data for pagination, e.g. containing the

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.action; package org.eclipse.hawkbit.mgmt.json.model.action;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -18,11 +22,6 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity;
import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindow; import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindow;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for Action to RESTful API representation. * A json annotated rest model for Action to RESTful API representation.
*/ */
@@ -33,39 +32,39 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(example = """ @Schema(example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408571231, "createdAt" : 1682408571231,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408571265, "lastModifiedAt" : 1682408571265,
"type" : "update", "type" : "update",
"status" : "finished", "status" : "finished",
"detailStatus" : "finished", "detailStatus" : "finished",
"rollout" : 1, "rollout" : 1,
"rolloutName" : "rollout", "rolloutName" : "rollout",
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/targets/target137/actions/1" "href" : "https://management-api.host.com/rest/v1/targets/target137/actions/1"
}, },
"target" : { "target" : {
"href" : "https://management-api.host.com/rest/v1/targets/target137", "href" : "https://management-api.host.com/rest/v1/targets/target137",
"name" : "target137" "name" : "target137"
}, },
"distributionset" : { "distributionset" : {
"href" : "https://management-api.host.com/rest/v1/distributionsets/1", "href" : "https://management-api.host.com/rest/v1/distributionsets/1",
"name" : "DS:1.0" "name" : "DS:1.0"
}, },
"status" : { "status" : {
"href" : "https://management-api.host.com/rest/v1/targets/target137/actions/1/status?offset=0&limit=50&sort=id%3ADESC" "href" : "https://management-api.host.com/rest/v1/targets/target137/actions/1/status?offset=0&limit=50&sort=id%3ADESC"
}, },
"rollout" : { "rollout" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/1", "href" : "https://management-api.host.com/rest/v1/rollouts/1",
"name" : "rollout" "name" : "rollout"
} }
}, },
"id" : 1, "id" : 1,
"forceType" : "forced" "forceType" : "forced"
}""") }""")
public class MgmtAction extends MgmtBaseEntity { public class MgmtAction extends MgmtBaseEntity {
/** /**

View File

@@ -9,13 +9,12 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.action; package org.eclipse.hawkbit.mgmt.json.model.action;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated model for Action updates in RESTful API representation. * A json annotated model for Action updates in RESTful API representation.
*/ */
@@ -24,6 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@ToString @ToString
public class MgmtActionRequestBodyPut { public class MgmtActionRequestBodyPut {
@JsonProperty(value="forceType") @JsonProperty(value = "forceType")
private MgmtActionType actionType; private MgmtActionType actionType;
} }

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.artifact; package org.eclipse.hawkbit.mgmt.json.model.artifact;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,12 +20,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for Artifact to RESTful API representation. * A json annotated rest model for Artifact to RESTful API representation.
*/ */
@@ -32,31 +30,31 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **download** - Download link of the artifact * **download** - Download link of the artifact
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408572660, "createdAt" : 1682408572660,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408572660, "lastModifiedAt" : 1682408572660,
"hashes" : { "hashes" : {
"sha1" : "70686514bec4a9f8188f88d470fb3d7999728fad", "sha1" : "70686514bec4a9f8188f88d470fb3d7999728fad",
"md5" : "f7c5b155e3636406cbc53c61f4692637", "md5" : "f7c5b155e3636406cbc53c61f4692637",
"sha256" : "efbbd71e3aa3c1db9ff3905c81f1220adb0e5db3c5438732eedf98ab006ca742" "sha256" : "efbbd71e3aa3c1db9ff3905c81f1220adb0e5db3c5438732eedf98ab006ca742"
}, },
"providedFilename" : "origFilename", "providedFilename" : "origFilename",
"size" : 11, "size" : 11,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/1/artifacts/1" "href" : "https://management-api.host.com/rest/v1/softwaremodules/1/artifacts/1"
}, },
"download" : { "download" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/1/artifacts/1/download" "href" : "https://management-api.host.com/rest/v1/softwaremodules/1/artifacts/1/download"
} }
}, },
"id" : 1 "id" : 1
}""") }""")
public class MgmtArtifact extends MgmtBaseEntity { public class MgmtArtifact extends MgmtBaseEntity {
@JsonProperty("id") @JsonProperty("id")

View File

@@ -12,8 +12,9 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -23,10 +24,6 @@ import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi; import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi;
import org.springframework.hateoas.RepresentationModel; import org.springframework.hateoas.RepresentationModel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Representation of an Action Id as a Json Object with link to the Action * Representation of an Action Id as a Json Object with link to the Action
* resource * resource
@@ -39,14 +36,14 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
{ {
"id" : 13, "id" : 13,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/targets/target2/actions/13" "href" : "https://management-api.host.com/rest/v1/targets/target2/actions/13"
} }
} }
}""") }""")
public class MgmtActionId extends RepresentationModel<MgmtActionId> { public class MgmtActionId extends RepresentationModel<MgmtActionId> {
@JsonProperty("id") @JsonProperty("id")

View File

@@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonValue;
/** /**
* Definition of the action cancel type for the distribution set invalidation * Definition of the action cancel type for the distribution set invalidation
* via REST management API. * via REST management API.
*
*/ */
public enum MgmtCancelationType { public enum MgmtCancelationType {

View File

@@ -12,6 +12,10 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -20,11 +24,6 @@ import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for DistributionSet to RESTful API * A json annotated rest model for DistributionSet to RESTful API
* representation. * representation.
@@ -36,102 +35,102 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **type** - The type of the distribution set * **type** - The type of the distribution set
* **modules** - List of software modules * **modules** - List of software modules
* **metadata** - List of metadata * **metadata** - List of metadata
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408574924, "createdAt" : 1682408574924,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408574925, "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" : 1682408574921, "createdAt" : 1682408574921,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408574926, "lastModifiedAt" : 1682408574926,
"name" : "Firmware", "name" : "Firmware",
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1", "description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
"version" : "1.0.42", "version" : "1.0.42",
"type" : "os", "type" : "os",
"typeName" : "OS", "typeName" : "OS",
"vendor" : "vendor Limited Inc, California", "vendor" : "vendor Limited Inc, California",
"locked" : true, "locked" : true,
"deleted" : false, "deleted" : false,
"encrypted" : false, "encrypted" : false,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/18" "href" : "https://management-api.host.com/rest/v1/softwaremodules/18"
} }
}, },
"id" : 18 "id" : 18
}, { }, {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408574920, "createdAt" : 1682408574920,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408574925, "lastModifiedAt" : 1682408574925,
"name" : "app runtime", "name" : "app runtime",
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1", "description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
"version" : "1.0.25", "version" : "1.0.25",
"type" : "runtime", "type" : "runtime",
"typeName" : "runtime", "typeName" : "runtime",
"vendor" : "vendor GmbH, Stuttgart, Germany", "vendor" : "vendor GmbH, Stuttgart, Germany",
"locked" : true, "locked" : true,
"deleted" : false, "deleted" : false,
"encrypted" : false, "encrypted" : false,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/17" "href" : "https://management-api.host.com/rest/v1/softwaremodules/17"
} }
}, },
"id" : 17 "id" : 17
}, { }, {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408574919, "createdAt" : 1682408574919,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408574926, "lastModifiedAt" : 1682408574926,
"name" : "application", "name" : "application",
"description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1", "description" : "Updated Desc: 2LaONizh7WZp0on6XEOZI9AwEYIjj77YZskEmA2LVrKtAOXj9vvqACopEghLMqt6DIWpIahn6XM4jUlRZ1T5SZS2NWMuWHGoFIg1",
"version" : "1.0.67", "version" : "1.0.67",
"type" : "application", "type" : "application",
"typeName" : "Application", "typeName" : "Application",
"vendor" : "vendor Limited, California", "vendor" : "vendor Limited, California",
"locked" : true, "locked" : true,
"deleted" : false, "deleted" : false,
"encrypted" : false, "encrypted" : false,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/16" "href" : "https://management-api.host.com/rest/v1/softwaremodules/16"
} }
}, },
"id" : 16 "id" : 16
} ], } ],
"requiredMigrationStep" : false, "requiredMigrationStep" : false,
"type" : "test_default_ds_type", "type" : "test_default_ds_type",
"typeName" : "OS (FW) mandatory, runtime (FW) and app (SW) optional", "typeName" : "OS (FW) mandatory, runtime (FW) and app (SW) optional",
"complete" : true, "complete" : true,
"deleted" : false, "deleted" : false,
"valid" : true, "valid" : true,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/distributionsets/6" "href" : "https://management-api.host.com/rest/v1/distributionsets/6"
}, },
"modules" : { "modules" : {
"href" : "https://management-api.host.com/rest/v1/distributionsets/6/assignedSM?offset=0&limit=50" "href" : "https://management-api.host.com/rest/v1/distributionsets/6/assignedSM?offset=0&limit=50"
}, },
"type" : { "type" : {
"href" : "https://management-api.host.com/rest/v1/distributionsettypes/24" "href" : "https://management-api.host.com/rest/v1/distributionsettypes/24"
}, },
"metadata" : { "metadata" : {
"href" : "https://management-api.host.com/rest/v1/distributionsets/6/metadata?offset=0&limit=50" "href" : "https://management-api.host.com/rest/v1/distributionsets/6/metadata?offset=0&limit=50"
} }
}, },
"id" : 6 "id" : 6
}""") }""")
public class MgmtDistributionSet extends MgmtNamedEntity { public class MgmtDistributionSet extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)
@@ -153,8 +152,8 @@ public class MgmtDistributionSet extends MgmtNamedEntity {
@JsonProperty @JsonProperty
@Schema(description = """ @Schema(description = """
True of the distribution set software module setup is complete as defined by the True of the distribution set software module setup is complete as defined by the
distribution set type""", example = "true") distribution set type""", example = "true")
private Boolean complete; private Boolean complete;
@JsonProperty @JsonProperty
@@ -172,8 +171,8 @@ public class MgmtDistributionSet extends MgmtNamedEntity {
@JsonProperty @JsonProperty
@Schema(description = """ @Schema(description = """
True if DS is a required migration step for another DS. As a result the DSs assignment will not be cancelled True if DS is a required migration step for another DS. As a result the DSs assignment will not be cancelled
when another DS is assigned (note: updatable only if DS is not yet assigned to a target)""", example = "false") when another DS is assigned (note: updatable only if DS is not yet assigned to a target)""", example = "false")
private boolean requiredMigrationStep; private boolean requiredMigrationStep;
@JsonProperty @JsonProperty

View File

@@ -11,6 +11,10 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -18,11 +22,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for DistributionSet for POST. * A json annotated rest model for DistributionSet for POST.
*/ */

View File

@@ -49,7 +49,7 @@ public class MgmtDistributionSetRequestBodyPut {
@JsonProperty @JsonProperty
@Schema(description = """ @Schema(description = """
True if DS is a required migration step for another DS. As a result the DSs assignment will not be cancelled True if DS is a required migration step for another DS. As a result the DSs assignment will not be cancelled
when another DS is assigned (note: updatable only if DS is not yet assigned to a target)""", example = "false") when another DS is assigned (note: updatable only if DS is not yet assigned to a target)""", example = "false")
private Boolean requiredMigrationStep; private Boolean requiredMigrationStep;
} }

View File

@@ -10,19 +10,18 @@
package org.eclipse.hawkbit.mgmt.json.model.distributionset; package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import java.util.HashMap;
import java.util.Map;
@NoArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE)
@Getter @Getter
@EqualsAndHashCode @EqualsAndHashCode
@@ -31,67 +30,67 @@ import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class MgmtDistributionSetStatistics { public class MgmtDistributionSetStatistics {
private static final String TOTAL = "total"; private static final String TOTAL = "total";
@JsonProperty("actions") @JsonProperty("actions")
private Map<String, Long> totalActionsPerStatus; private Map<String, Long> totalActionsPerStatus;
@JsonProperty("rollouts") @JsonProperty("rollouts")
private Map<String, Long> totalRolloutsPerStatus; private Map<String, Long> totalRolloutsPerStatus;
@JsonProperty @JsonProperty
private Long totalAutoAssignments;
public static class Builder {
private final Map<String, Long> totalActionsPerStatus;
private final Map<String, Long> totalRolloutsPerStatus;
private Long totalAutoAssignments; private Long totalAutoAssignments;
private final boolean fullRepresentation;
public Builder(boolean fullRepresentation) { public static class Builder {
totalActionsPerStatus = new HashMap<>();
totalRolloutsPerStatus = new HashMap<>(); private final Map<String, Long> totalActionsPerStatus;
this.fullRepresentation = fullRepresentation; private final Map<String, Long> totalRolloutsPerStatus;
private final boolean fullRepresentation;
private Long totalAutoAssignments;
public Builder(boolean fullRepresentation) {
totalActionsPerStatus = new HashMap<>();
totalRolloutsPerStatus = new HashMap<>();
this.fullRepresentation = fullRepresentation;
}
public Builder addTotalActionPerStatus(String status, Long count) {
totalActionsPerStatus.put(status, count);
return this;
}
public Builder addTotalRolloutPerStatus(String status, Long count) {
totalRolloutsPerStatus.put(status, count);
return this;
}
public Builder addTotalAutoAssignments(Long count) {
totalAutoAssignments = count;
return this;
}
public MgmtDistributionSetStatistics build() {
MgmtDistributionSetStatistics statistics = new MgmtDistributionSetStatistics();
statistics.totalActionsPerStatus = calculateTotalWithStatus(totalActionsPerStatus);
statistics.totalRolloutsPerStatus = calculateTotalWithStatus(totalRolloutsPerStatus);
statistics.totalAutoAssignments = calculateTotalAutoAssignments();
return statistics;
}
private Map<String, Long> calculateTotalWithStatus(Map<String, Long> statusMap) {
if (!fullRepresentation && statusMap.isEmpty()) {
return statusMap;
}
long total = statusMap.values().stream().mapToLong(Long::longValue).sum();
statusMap.put(TOTAL, total);
return statusMap;
}
private Long calculateTotalAutoAssignments() {
if (fullRepresentation) {
return totalAutoAssignments == null ? Long.valueOf(0) : totalAutoAssignments;
}
return totalAutoAssignments;
}
} }
public Builder addTotalActionPerStatus(String status, Long count) {
totalActionsPerStatus.put(status, count);
return this;
}
public Builder addTotalRolloutPerStatus(String status, Long count) {
totalRolloutsPerStatus.put(status, count);
return this;
}
public Builder addTotalAutoAssignments(Long count) {
totalAutoAssignments = count;
return this;
}
public MgmtDistributionSetStatistics build() {
MgmtDistributionSetStatistics statistics = new MgmtDistributionSetStatistics();
statistics.totalActionsPerStatus = calculateTotalWithStatus(totalActionsPerStatus);
statistics.totalRolloutsPerStatus = calculateTotalWithStatus(totalRolloutsPerStatus);
statistics.totalAutoAssignments = calculateTotalAutoAssignments();
return statistics;
}
private Map<String, Long> calculateTotalWithStatus(Map<String, Long> statusMap) {
if (!fullRepresentation && statusMap.isEmpty()) {
return statusMap;
}
long total = statusMap.values().stream().mapToLong(Long::longValue).sum();
statusMap.put(TOTAL, total);
return statusMap;
}
private Long calculateTotalAutoAssignments() {
if (fullRepresentation) {
return totalAutoAssignments == null ? Long.valueOf(0) : totalAutoAssignments;
}
return totalAutoAssignments;
}
}
} }

View File

@@ -9,15 +9,14 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.distributionset; package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody; import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Request Body of Target for assignment operations (ID only). * Request Body of Target for assignment operations (ID only).
*/ */

View File

@@ -11,6 +11,10 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -18,11 +22,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.hateoas.RepresentationModel; import org.springframework.hateoas.RepresentationModel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Response Body of Target for assignment operations. * Response Body of Target for assignment operations.
*/ */

View File

@@ -9,12 +9,11 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.distributionsettype; package org.eclipse.hawkbit.mgmt.json.model.distributionsettype;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@@ -32,33 +31,33 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtTypeEntity;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **mandatorymodules** - Link to mandatory software modules types in this distribution set type * **mandatorymodules** - Link to mandatory software modules types in this distribution set type
* **optionalmodules** - Link to optional software modules types in this distribution set type * **optionalmodules** - Link to optional software modules types in this distribution set type
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408579418, "createdAt" : 1682408579418,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408579459, "lastModifiedAt" : 1682408579459,
"name" : "OS (FW) mandatory, runtime (FW) and app (SW) optional", "name" : "OS (FW) mandatory, runtime (FW) and app (SW) optional",
"description" : "Desc1234", "description" : "Desc1234",
"key" : "test_default_ds_type", "key" : "test_default_ds_type",
"deleted" : false, "deleted" : false,
"colour" : "rgb(86,37,99)", "colour" : "rgb(86,37,99)",
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/distributionsettypes/14" "href" : "https://management-api.host.com/rest/v1/distributionsettypes/14"
}, },
"mandatorymodules" : { "mandatorymodules" : {
"href" : "https://management-api.host.com/rest/v1/distributionsettypes/14/mandatorymoduletypes" "href" : "https://management-api.host.com/rest/v1/distributionsettypes/14/mandatorymoduletypes"
}, },
"optionalmodules" : { "optionalmodules" : {
"href" : "https://management-api.host.com/rest/v1/distributionsettypes/14/optionalmoduletypes" "href" : "https://management-api.host.com/rest/v1/distributionsettypes/14/optionalmoduletypes"
} }
}, },
"id" : 14 "id" : 14
}""") }""")
public class MgmtDistributionSetType extends MgmtTypeEntity { public class MgmtDistributionSetType extends MgmtTypeEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionsettype;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -18,8 +19,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Request Body for DistributionSetType POST. * Request Body for DistributionSetType POST.
*/ */

View File

@@ -9,6 +9,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.rollout; package org.eclipse.hawkbit.mgmt.json.model.rollout;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,9 +18,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
/** /**
* Model for defining Conditions and Actions * Model for defining Conditions and Actions
*/ */

View File

@@ -26,18 +26,17 @@ import lombok.experimental.Accessors;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class MgmtRolloutCondition { public class MgmtRolloutCondition {
public enum Condition {
THRESHOLD
}
@Schema(description = "The type of the condition") @Schema(description = "The type of the condition")
private Condition condition = Condition.THRESHOLD; private Condition condition = Condition.THRESHOLD;
@Schema(description = "The expression according to the condition, e.g. the value of threshold in percentage", @Schema(description = "The expression according to the condition, e.g. the value of threshold in percentage",
example = "50") example = "50")
private String expression = "100"; private String expression = "100";
public MgmtRolloutCondition(final Condition condition, final String expression) { public MgmtRolloutCondition(final Condition condition, final String expression) {
this.condition = condition; this.condition = condition;
this.expression = expression; this.expression = expression;
} }
public enum Condition {
THRESHOLD
}
} }

View File

@@ -29,15 +29,10 @@ import lombok.experimental.Accessors;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class MgmtRolloutErrorAction { public class MgmtRolloutErrorAction {
public enum ErrorAction {
PAUSE
}
@Schema(description = "The error action to execute") @Schema(description = "The error action to execute")
private ErrorAction action = ErrorAction.PAUSE; private ErrorAction action = ErrorAction.PAUSE;
@Schema(description = "The expression for the error action", example = "80") @Schema(description = "The expression for the error action", example = "80")
private String expression; private String expression;
/** /**
* Creates a rollout error action * Creates a rollout error action
* *
@@ -48,4 +43,8 @@ public class MgmtRolloutErrorAction {
this.action = action; this.action = action;
this.expression = expression; this.expression = expression;
} }
public enum ErrorAction {
PAUSE
}
} }

View File

@@ -12,6 +12,10 @@ package org.eclipse.hawkbit.mgmt.json.model.rollout;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.Data; import lombok.Data;
@@ -22,11 +26,6 @@ import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@@ -34,72 +33,72 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **start** - Link to start the rollout in sync mode * **start** - Link to start the rollout in sync mode
* **pause** - Link to pause a running rollout * **pause** - Link to pause a running rollout
* **triggerNextGroup** - Link for triggering next rollout group on a running rollout * **triggerNextGroup** - Link for triggering next rollout group on a running rollout
* **resume** - Link to resume a paused rollout * **resume** - Link to resume a paused rollout
* **groups** - Link to retrieve the groups a rollout * **groups** - Link to retrieve the groups a rollout
* **approve** - Link to approve a rollout * **approve** - Link to approve a rollout
* **deny** - Link to deny a rollout * **deny** - Link to deny a rollout
* **distributionset** - The link to the distribution set * **distributionset** - The link to the distribution set
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408568812, "createdAt" : 1682408568812,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408568812, "lastModifiedAt" : 1682408568812,
"name" : "exampleRollout", "name" : "exampleRollout",
"description" : "Rollout for all named targets", "description" : "Rollout for all named targets",
"targetFilterQuery" : "id==targets-*", "targetFilterQuery" : "id==targets-*",
"distributionSetId" : 6, "distributionSetId" : 6,
"status" : "creating", "status" : "creating",
"totalTargets" : 20, "totalTargets" : 20,
"totalTargetsPerStatus" : { "totalTargetsPerStatus" : {
"running" : 0, "running" : 0,
"notstarted" : 20, "notstarted" : 20,
"scheduled" : 0, "scheduled" : 0,
"cancelled" : 0, "cancelled" : 0,
"finished" : 0, "finished" : 0,
"error" : 0 "error" : 0
}, },
"totalGroups" : 5, "totalGroups" : 5,
"startAt" : 1682408570791, "startAt" : 1682408570791,
"forcetime" : 1682408571791, "forcetime" : 1682408571791,
"deleted" : false, "deleted" : false,
"type" : "forced", "type" : "forced",
"_links" : { "_links" : {
"start" : { "start" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/start" "href" : "https://management-api.host.com/rest/v1/rollouts/6/start"
}, },
"pause" : { "pause" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/pause" "href" : "https://management-api.host.com/rest/v1/rollouts/6/pause"
}, },
"resume" : { "resume" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/resume" "href" : "https://management-api.host.com/rest/v1/rollouts/6/resume"
}, },
"triggerNextGroup" : { "triggerNextGroup" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/triggerNextGroup" "href" : "https://management-api.host.com/rest/v1/rollouts/6/triggerNextGroup"
}, },
"approve" : { "approve" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/approve" "href" : "https://management-api.host.com/rest/v1/rollouts/6/approve"
}, },
"deny" : { "deny" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/deny" "href" : "https://management-api.host.com/rest/v1/rollouts/6/deny"
}, },
"groups" : { "groups" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6/deploygroups?offset=0&limit=50" "href" : "https://management-api.host.com/rest/v1/rollouts/6/deploygroups?offset=0&limit=50"
}, },
"distributionset" : { "distributionset" : {
"href" : "https://management-api.host.com/rest/v1/distributionsets/6", "href" : "https://management-api.host.com/rest/v1/distributionsets/6",
"name" : "bd3a71cb-6c8f-445c-adbb-e221414dcd96:1.0" "name" : "bd3a71cb-6c8f-445c-adbb-e221414dcd96:1.0"
}, },
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/6" "href" : "https://management-api.host.com/rest/v1/rollouts/6"
} }
}, },
"id" : 6 "id" : 6
}""") }""")
public class MgmtRolloutResponseBody extends MgmtNamedEntity { public class MgmtRolloutResponseBody extends MgmtNamedEntity {
@Schema(description = "Target filter query language expression", example = "controllerId==exampleTarget*") @Schema(description = "Target filter query language expression", example = "controllerId==exampleTarget*")

View File

@@ -11,6 +11,10 @@ package org.eclipse.hawkbit.mgmt.json.model.rollout;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -20,11 +24,6 @@ import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtDynamicRolloutGroupTemplate; import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtDynamicRolloutGroupTemplate;
import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroup; import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroup;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Model for request containing a rollout body e.g. in a POST request of * Model for request containing a rollout body e.g. in a POST request of
* creating a rollout via REST API. * creating a rollout via REST API.
@@ -36,33 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(example = """ @Schema(example = """
{ {
"distributionSetId" : 6, "distributionSetId" : 6,
"targetFilterQuery" : "id==targets-*", "targetFilterQuery" : "id==targets-*",
"description" : "Rollout for all named targets", "description" : "Rollout for all named targets",
"amountGroups" : 5, "amountGroups" : 5,
"type" : "forced", "type" : "forced",
"successCondition" : { "successCondition" : {
"condition" : "THRESHOLD", "condition" : "THRESHOLD",
"expression" : "50" "expression" : "50"
}, },
"successAction" : { "successAction" : {
"expression" : "", "expression" : "",
"action" : "NEXTGROUP" "action" : "NEXTGROUP"
}, },
"name" : "exampleRollout", "name" : "exampleRollout",
"forcetime" : 1682408571791, "forcetime" : 1682408571791,
"errorAction" : { "errorAction" : {
"expression" : "", "expression" : "",
"action" : "PAUSE" "action" : "PAUSE"
}, },
"confirmationRequired" : false, "confirmationRequired" : false,
"errorCondition" : { "errorCondition" : {
"condition" : "THRESHOLD", "condition" : "THRESHOLD",
"expression" : "80" "expression" : "80"
}, },
"startAt" : 1682408570791 "startAt" : 1682408570791
}""") }""")
public class MgmtRolloutRestRequestBodyPost extends AbstractMgmtRolloutConditionsEntity { public class MgmtRolloutRestRequestBodyPost extends AbstractMgmtRolloutConditionsEntity {
@Schema(description = "Target filter query language expression", example = "id==targets-*") @Schema(description = "Target filter query language expression", example = "id==targets-*")
@@ -94,8 +93,8 @@ public class MgmtRolloutRestRequestBodyPost extends AbstractMgmtRolloutCondition
@JsonProperty @JsonProperty
@Schema(description = """ @Schema(description = """
(Available with user consent flow active) If the confirmation is required for this rollout. Value will be used (Available with user consent flow active) If the confirmation is required for this rollout. Value will be used
if confirmation options are missing in the rollout group definitions. Confirmation is required per default""", if confirmation options are missing in the rollout group definitions. Confirmation is required per default""",
example = "false") example = "false")
private Boolean confirmationRequired; private Boolean confirmationRequired;

View File

@@ -12,17 +12,12 @@ package org.eclipse.hawkbit.mgmt.json.model.rollout;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroup;
import java.util.List;
/** /**
* Model for request containing a rollout body e.g. in a POST request of * Model for request containing a rollout body e.g. in a POST request of
@@ -35,9 +30,9 @@ import java.util.List;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(example = """ @Schema(example = """
{ {
"name" : "exampleRollout", "name" : "exampleRollout",
"description" : "Rollout for all named targets" "description" : "Rollout for all named targets"
}""") }""")
public class MgmtRolloutRestRequestBodyPut extends MgmtNamedEntity { public class MgmtRolloutRestRequestBodyPut extends MgmtNamedEntity {
} }

View File

@@ -26,17 +26,16 @@ import lombok.experimental.Accessors;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class MgmtRolloutSuccessAction { public class MgmtRolloutSuccessAction {
public enum SuccessAction {
NEXTGROUP
}
@Schema(description = "The success action to execute") @Schema(description = "The success action to execute")
private SuccessAction action = SuccessAction.NEXTGROUP; private SuccessAction action = SuccessAction.NEXTGROUP;
@Schema(description = "The expression for the success action") @Schema(description = "The expression for the success action")
private String expression; private String expression;
public MgmtRolloutSuccessAction(final SuccessAction action, final String expression) { public MgmtRolloutSuccessAction(final SuccessAction action, final String expression) {
this.action = action; this.action = action;
this.expression = expression; this.expression = expression;
} }
public enum SuccessAction {
NEXTGROUP
}
} }

View File

@@ -9,13 +9,12 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup; package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
/** /**
* Model for defining the Attributes of a Rollout Group * Model for defining the Attributes of a Rollout Group
*/ */

View File

@@ -9,6 +9,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup; package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,9 +18,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.rollout.AbstractMgmtRolloutConditionsEntity; import org.eclipse.hawkbit.mgmt.json.model.rollout.AbstractMgmtRolloutConditionsEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
/** /**
* Model for defining the Attributes of a Rollout Group * Model for defining the Attributes of a Rollout Group
*/ */

View File

@@ -35,49 +35,49 @@ import lombok.experimental.Accessors;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(example = """ @Schema(example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408569768, "createdAt" : 1682408569768,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408569795, "lastModifiedAt" : 1682408569795,
"name" : "group-1", "name" : "group-1",
"description" : "group-1", "description" : "group-1",
"successCondition" : { "successCondition" : {
"condition" : "THRESHOLD", "condition" : "THRESHOLD",
"expression" : "10" "expression" : "10"
}, },
"successAction" : { "successAction" : {
"action" : "NEXTGROUP", "action" : "NEXTGROUP",
"expression" : "" "expression" : ""
}, },
"errorCondition" : { "errorCondition" : {
"condition" : "THRESHOLD", "condition" : "THRESHOLD",
"expression" : "50" "expression" : "50"
}, },
"errorAction" : { "errorAction" : {
"action" : "PAUSE", "action" : "PAUSE",
"expression" : "" "expression" : ""
}, },
"targetFilterQuery" : "", "targetFilterQuery" : "",
"targetPercentage" : 20.0, "targetPercentage" : 20.0,
"confirmationRequired" : false, "confirmationRequired" : false,
"status" : "ready", "status" : "ready",
"totalTargets" : 4, "totalTargets" : 4,
"totalTargetsPerStatus" : { "totalTargetsPerStatus" : {
"running" : 0, "running" : 0,
"notstarted" : 4, "notstarted" : 4,
"scheduled" : 0, "scheduled" : 0,
"cancelled" : 0, "cancelled" : 0,
"finished" : 0, "finished" : 0,
"error" : 0 "error" : 0
}, },
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/rollouts/17/deploygroups/78" "href" : "https://management-api.host.com/rest/v1/rollouts/17/deploygroups/78"
} }
}, },
"id" : 78 "id" : 78
}""") }""")
public class MgmtRolloutGroupResponseBody extends MgmtRolloutGroup { public class MgmtRolloutGroupResponseBody extends MgmtRolloutGroup {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; package org.eclipse.hawkbit.mgmt.json.model.softwaremodule;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,11 +20,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for SoftwareModule to RESTful API representation. * A json annotated rest model for SoftwareModule to RESTful API representation.
*/ */
@@ -31,41 +30,41 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **type** - The software module type of the entity * **type** - The software module type of the entity
* **artifacts** - List of artifacts of given software module * **artifacts** - List of artifacts of given software module
* **metadata** - List of metadata * **metadata** - List of metadata
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408572790, "createdAt" : 1682408572790,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408572791, "lastModifiedAt" : 1682408572791,
"name" : "os", "name" : "os",
"description" : "a description", "description" : "a description",
"version" : "1.0", "version" : "1.0",
"type" : "os", "type" : "os",
"typeName" : "OS", "typeName" : "OS",
"vendor" : "Vendor Limited, California", "vendor" : "Vendor Limited, California",
"encrypted" : false, "encrypted" : false,
"locked" : true, "locked" : true,
"deleted" : false, "deleted" : false,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/6" "href" : "https://management-api.host.com/rest/v1/softwaremodules/6"
}, },
"artifacts" : { "artifacts" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/6/artifacts" "href" : "https://management-api.host.com/rest/v1/softwaremodules/6/artifacts"
}, },
"type" : { "type" : {
"href" : "https://management-api.host.com/rest/v1/softwaremoduletypes/13" "href" : "https://management-api.host.com/rest/v1/softwaremoduletypes/13"
}, },
"metadata" : { "metadata" : {
"href" : "https://management-api.host.com/rest/v1/softwaremodules/6/metadata?offset=0&limit=50" "href" : "https://management-api.host.com/rest/v1/softwaremodules/6/metadata?offset=0&limit=50"
} }
}, },
"id" : 6 "id" : 6
}""") }""")
public class MgmtSoftwareModule extends MgmtNamedEntity { public class MgmtSoftwareModule extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -9,9 +9,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; package org.eclipse.hawkbit.mgmt.json.model.softwaremodule;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
/** /**
* Request Body of SoftwareModule for assignment operations (ID only). * Request Body of SoftwareModule for assignment operations (ID only).

View File

@@ -9,12 +9,11 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@@ -32,23 +31,23 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtTypeEntity;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(example = """ @Schema(example = """
{ {
"createdBy" : "system", "createdBy" : "system",
"createdAt" : 1682408579390, "createdAt" : 1682408579390,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408579394, "lastModifiedAt" : 1682408579394,
"name" : "Application", "name" : "Application",
"description" : "Updated description.", "description" : "Updated description.",
"key" : "application", "key" : "application",
"maxAssignments" : 2147483647, "maxAssignments" : 2147483647,
"deleted" : false, "deleted" : false,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/softwaremoduletypes/4" "href" : "https://management-api.host.com/rest/v1/softwaremoduletypes/4"
} }
}, },
"id" : 4 "id" : 4
}""") }""")
public class MgmtSoftwareModuleType extends MgmtTypeEntity { public class MgmtSoftwareModuleType extends MgmtTypeEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -9,9 +9,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
/** /**
* Request Body of SoftwareModuleType for assignment operations (ID only). * Request Body of SoftwareModuleType for assignment operations (ID only).

View File

@@ -10,19 +10,15 @@
package org.eclipse.hawkbit.mgmt.json.model.system; package org.eclipse.hawkbit.mgmt.json.model.system;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.hateoas.RepresentationModel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.hateoas.RepresentationModel;
/** /**
* A json annotated rest model for a tenant configuration value to RESTful API * A json annotated rest model for a tenant configuration value to RESTful API
@@ -57,15 +53,15 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
* **batch.assignments.enabled** - Boolean, The configuration key 'batch.assignments.enabled' defines if distribution set can be assigned to multiple targets in a single batch message. * **batch.assignments.enabled** - Boolean, The configuration key 'batch.assignments.enabled' defines if distribution set can be assigned to multiple targets in a single batch message.
* **implicit.lock.enabled** - Boolean (true by default), The configuration key 'implicit.lock.enabled' defines if distribution set and their software modules shall be implicitly locked when assigned to target, rollout or target filter. * **implicit.lock.enabled** - Boolean (true by default), The configuration key 'implicit.lock.enabled' defines if distribution set and their software modules shall be implicitly locked when assigned to target, rollout or target filter.
""", example = """ """, example = """
{ {
"value" : "", "value" : "",
"global" : true, "global" : true,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/system/configs/authentication.gatewaytoken.key" "href" : "https://management-api.host.com/rest/v1/system/configs/authentication.gatewaytoken.key"
} }
} }
}""") }""")
public class MgmtSystemTenantConfigurationValue extends RepresentationModel<MgmtSystemTenantConfigurationValue> { public class MgmtSystemTenantConfigurationValue extends RepresentationModel<MgmtSystemTenantConfigurationValue> {
@JsonInclude @JsonInclude

View File

@@ -30,10 +30,8 @@ public class MgmtSystemCache {
private final Collection<String> keys; private final Collection<String> keys;
/** /**
* @param name * @param name the name of the cache
* the name of the cache * @param cacheKeys the keys which contains in the cache
* @param cacheKeys
* the keys which contains in the cache
*/ */
public MgmtSystemCache(final String name, final Collection<String> cacheKeys) { public MgmtSystemCache(final String name, final Collection<String> cacheKeys) {
this.name = name; this.name = name;

View File

@@ -11,17 +11,16 @@ package org.eclipse.hawkbit.mgmt.json.model.tag;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for DSAssigmentResult to RESTful API representation. * A json annotated rest model for DSAssigmentResult to RESTful API representation.
* *

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.tag; package org.eclipse.hawkbit.mgmt.json.model.tag;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,12 +20,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for Tag to RESTful API representation. * A json annotated rest model for Tag to RESTful API representation.
*/ */
@@ -32,27 +30,27 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **assignedDistributionSets** - Links to assigned distribution sets * **assignedDistributionSets** - Links to assigned distribution sets
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408561990, "createdAt" : 1682408561990,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408561992, "lastModifiedAt" : 1682408561992,
"name" : "DsTag", "name" : "DsTag",
"description" : "My name is DsTag", "description" : "My name is DsTag",
"colour" : "default", "colour" : "default",
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/distributionsettags/6" "href" : "https://management-api.host.com/rest/v1/distributionsettags/6"
}, },
"assignedDistributionSets" : { "assignedDistributionSets" : {
"href" : "https://management-api.host.com/rest/v1/distributionsettags/6/assigned?offset=0&limit=50" "href" : "https://management-api.host.com/rest/v1/distributionsettags/6/assigned?offset=0&limit=50"
} }
}, },
"id" : 6 "id" : 6
}""") }""")
public class MgmtTag extends MgmtNamedEntity { public class MgmtTag extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -11,17 +11,16 @@ package org.eclipse.hawkbit.mgmt.json.model.tag;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for TargetTagAssigmentResult to RESTful API representation. * A json annotated rest model for TargetTagAssigmentResult to RESTful API representation.
* *

View File

@@ -3,6 +3,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.target; package org.eclipse.hawkbit.mgmt.json.model.target;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -12,9 +14,6 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody; import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Request Body of DistributionSet for assignment operations (ID only). * Request Body of DistributionSet for assignment operations (ID only).
*/ */
@@ -33,8 +32,8 @@ public class MgmtDistributionSetAssignment extends MgmtId {
@JsonProperty @JsonProperty
@Schema(description = """ @Schema(description = """
(Available with user consent flow active) Specifies if the confirmation by the device (Available with user consent flow active) Specifies if the confirmation by the device
is required for this action""", example = "false") is required for this action""", example = "false")
private Boolean confirmationRequired; private Boolean confirmationRequired;
@Schema(description = "The type of the assignment") @Schema(description = "The type of the assignment")
@@ -46,8 +45,7 @@ public class MgmtDistributionSetAssignment extends MgmtId {
/** /**
* Constructor * Constructor
* *
* @param id * @param id ID of object
* ID of object
*/ */
@JsonCreator @JsonCreator
public MgmtDistributionSetAssignment(@JsonProperty(required = true, value = "id") final Long id) { public MgmtDistributionSetAssignment(@JsonProperty(required = true, value = "id") final Long id) {

View File

@@ -33,8 +33,7 @@ public class MgmtDistributionSetAssignments extends ArrayList<MgmtDistributionSe
* Constructor for an object that contains a single distribution set * Constructor for an object that contains a single distribution set
* assignment * assignment
* *
* @param assignment * @param assignment the assignment
* the assignment
*/ */
public MgmtDistributionSetAssignments(final MgmtDistributionSetAssignment assignment) { public MgmtDistributionSetAssignments(final MgmtDistributionSetAssignment assignment) {
add(assignment); add(assignment);
@@ -44,8 +43,7 @@ public class MgmtDistributionSetAssignments extends ArrayList<MgmtDistributionSe
* Constructor for an object that contains multiple distribution set * Constructor for an object that contains multiple distribution set
* assignments * assignments
* *
* @param assignments * @param assignments the assignments
* the assignments
*/ */
public MgmtDistributionSetAssignments(final List<MgmtDistributionSetAssignment> assignments) { public MgmtDistributionSetAssignments(final List<MgmtDistributionSetAssignment> assignments) {
super(assignments); super(assignments);

View File

@@ -3,6 +3,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.target; package org.eclipse.hawkbit.mgmt.json.model.target;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -11,11 +15,6 @@ import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.MgmtPollStatus; import org.eclipse.hawkbit.mgmt.json.model.MgmtPollStatus;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for Target to RESTful API representation. * A json annotated rest model for Target to RESTful API representation.
*/ */
@@ -26,65 +25,65 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **assignedDS** - Links to assigned distribution sets * **assignedDS** - Links to assigned distribution sets
* **installedDS** - Links to installed distribution sets * **installedDS** - Links to installed distribution sets
* **attributes** - Links to attributes of the target * **attributes** - Links to attributes of the target
* **actions** - Links to actions of the target * **actions** - Links to actions of the target
* **metadata** - List of metadata * **metadata** - List of metadata
* **targetType** - The link to the target type * **targetType** - The link to the target type
* **autoConfirm** - The link to the detailed auto confirm state * **autoConfirm** - The link to the detailed auto confirm state
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408577979, "createdAt" : 1682408577979,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408577988, "lastModifiedAt" : 1682408577988,
"name" : "137", "name" : "137",
"description" : "My name is 137", "description" : "My name is 137",
"controllerId" : "137", "controllerId" : "137",
"updateStatus" : "in_sync", "updateStatus" : "in_sync",
"lastControllerRequestAt" : 1682408577978, "lastControllerRequestAt" : 1682408577978,
"installedAt" : 1682408577987, "installedAt" : 1682408577987,
"ipAddress" : "192.168.0.1", "ipAddress" : "192.168.0.1",
"address" : "http://192.168.0.1", "address" : "http://192.168.0.1",
"pollStatus" : { "pollStatus" : {
"lastRequestAt" : 1682408577978, "lastRequestAt" : 1682408577978,
"nextExpectedRequestAt" : 1682451777978, "nextExpectedRequestAt" : 1682451777978,
"overdue" : false "overdue" : false
}, },
"securityToken" : "949f1c3487125467464a960d750373c1", "securityToken" : "949f1c3487125467464a960d750373c1",
"requestAttributes" : true, "requestAttributes" : true,
"targetType" : 13, "targetType" : 13,
"targetTypeName" : "defaultType", "targetTypeName" : "defaultType",
"autoConfirmActive" : false, "autoConfirmActive" : false,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/targets/137" "href" : "https://management-api.host.com/rest/v1/targets/137"
}, },
"assignedDS" : { "assignedDS" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/assignedDS" "href" : "https://management-api.host.com/rest/v1/targets/137/assignedDS"
}, },
"installedDS" : { "installedDS" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/installedDS" "href" : "https://management-api.host.com/rest/v1/targets/137/installedDS"
}, },
"attributes" : { "attributes" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/attributes" "href" : "https://management-api.host.com/rest/v1/targets/137/attributes"
}, },
"actions" : { "actions" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/actions?offset=0&limit=50&sort=id%3ADESC" "href" : "https://management-api.host.com/rest/v1/targets/137/actions?offset=0&limit=50&sort=id%3ADESC"
}, },
"metadata" : { "metadata" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/metadata?offset=0&limit=50" "href" : "https://management-api.host.com/rest/v1/targets/137/metadata?offset=0&limit=50"
}, },
"targetType" : { "targetType" : {
"href" : "https://management-api.host.com/rest/v1/targettypes/13" "href" : "https://management-api.host.com/rest/v1/targettypes/13"
}, },
"autoConfirm" : { "autoConfirm" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/autoConfirm" "href" : "https://management-api.host.com/rest/v1/targets/137/autoConfirm"
} }
} }
}""") }""")
public class MgmtTarget extends MgmtNamedEntity { public class MgmtTarget extends MgmtNamedEntity {
@JsonProperty(required = true) @JsonProperty(required = true)

View File

@@ -3,12 +3,12 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.target; package org.eclipse.hawkbit.mgmt.json.model.target;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serial; import java.io.Serial;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
/** /**
* {@link Map} with attributes of SP Target. * {@link Map} with attributes of SP Target.
*/ */

View File

@@ -9,9 +9,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.target; package org.eclipse.hawkbit.mgmt.json.model.target;
import jakarta.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -20,8 +21,6 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.hateoas.RepresentationModel; import org.springframework.hateoas.RepresentationModel;
import jakarta.validation.constraints.NotNull;
/** /**
* Response representing the current state of auto-confirmation for a specific target * Response representing the current state of auto-confirmation for a specific target
*/ */
@@ -33,20 +32,20 @@ import jakarta.validation.constraints.NotNull;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({ "active", "initiator", "remark", "activatedAt" }) @JsonPropertyOrder({ "active", "initiator", "remark", "activatedAt" })
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **deactivate** - Reference link to deactivate auto confirm (present if active) * **deactivate** - Reference link to deactivate auto confirm (present if active)
""", example = """ """, example = """
{ {
"active" : true, "active" : true,
"initiator" : "custom_initiator_value", "initiator" : "custom_initiator_value",
"remark" : "custom_remark", "remark" : "custom_remark",
"activatedAt" : 1682408577704, "activatedAt" : 1682408577704,
"_links" : { "_links" : {
"deactivate" : { "deactivate" : {
"href" : "https://management-api.host.com/rest/v1/targets/137/autoConfirm/deactivate" "href" : "https://management-api.host.com/rest/v1/targets/137/autoConfirm/deactivate"
} }
} }
}""") }""")
public class MgmtTargetAutoConfirm extends RepresentationModel<MgmtTargetAutoConfirm> { public class MgmtTargetAutoConfirm extends RepresentationModel<MgmtTargetAutoConfirm> {
@NotNull @NotNull

View File

@@ -9,6 +9,7 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.targetfilter; package org.eclipse.hawkbit.mgmt.json.model.targetfilter;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@@ -16,8 +17,6 @@ import lombok.experimental.Accessors;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Request Body of DistributionSet Id and Action Type for target filter auto * Request Body of DistributionSet Id and Action Type for target filter auto
* assignment operation. * assignment operation.

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model.targetfilter; package org.eclipse.hawkbit.mgmt.json.model.targetfilter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,11 +20,6 @@ import lombok.ToString;
import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* A json annotated rest model for Target Filter Queries to RESTful API representation. * A json annotated rest model for Target Filter Queries to RESTful API representation.
*/ */
@@ -30,30 +29,30 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(Include.ALWAYS) @JsonInclude(Include.ALWAYS)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **autoAssignDS** - Link to manage the auto assign distribution set * **autoAssignDS** - Link to manage the auto assign distribution set
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408566380, "createdAt" : 1682408566380,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408566385, "lastModifiedAt" : 1682408566385,
"name" : "filter1", "name" : "filter1",
"query" : "name==*", "query" : "name==*",
"autoAssignDistributionSet" : 3, "autoAssignDistributionSet" : 3,
"autoAssignActionType" : "forced", "autoAssignActionType" : "forced",
"autoAssignWeight" : null, "autoAssignWeight" : null,
"confirmationRequired" : null, "confirmationRequired" : null,
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/targetfilters/5" "href" : "https://management-api.host.com/rest/v1/targetfilters/5"
}, },
"autoAssignDS" : { "autoAssignDS" : {
"href" : "https://management-api.host.com/rest/v1/targetfilters/5/autoAssignDS" "href" : "https://management-api.host.com/rest/v1/targetfilters/5/autoAssignDS"
} }
}, },
"id" : 5 "id" : 5
}""") }""")
public class MgmtTargetFilterQuery extends MgmtBaseEntity { public class MgmtTargetFilterQuery extends MgmtBaseEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -30,27 +30,27 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtTypeEntity;
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = """ @Schema(description = """
**_links**: **_links**:
* **compatibledistributionsettypes** - Link to the compatible distribution set types in this target type * **compatibledistributionsettypes** - Link to the compatible distribution set types in this target type
""", example = """ """, example = """
{ {
"createdBy" : "bumlux", "createdBy" : "bumlux",
"createdAt" : 1682408564546, "createdAt" : 1682408564546,
"lastModifiedBy" : "bumlux", "lastModifiedBy" : "bumlux",
"lastModifiedAt" : 1682408564546, "lastModifiedAt" : 1682408564546,
"name" : "TargetType", "name" : "TargetType",
"description" : "TargetType description", "description" : "TargetType description",
"colour" : "#000000", "colour" : "#000000",
"_links" : { "_links" : {
"self" : { "self" : {
"href" : "https://management-api.host.com/rest/v1/targettypes/8" "href" : "https://management-api.host.com/rest/v1/targettypes/8"
}, },
"compatibledistributionsettypes" : { "compatibledistributionsettypes" : {
"href" : "https://management-api.host.com/rest/v1/targettypes/8/compatibledistributionsettypes" "href" : "https://management-api.host.com/rest/v1/targettypes/8/compatibledistributionsettypes"
} }
}, },
"id" : 8 "id" : 8
}""") }""")
public class MgmtTargetType extends MgmtTypeEntity { public class MgmtTargetType extends MgmtTypeEntity {
@JsonProperty(value = "id", required = true) @JsonProperty(value = "id", required = true)

View File

@@ -35,42 +35,37 @@ public interface MgmtActionRestApi {
/** /**
* Handles the GET request of retrieving all actions. * Handles the GET request of retrieving all actions.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of actions for pagination, might not be
* the offset of list of actions for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=distributionSet.id==1}
* {@code field:direction, field:direction} * @param representationModeParam the representation mode parameter specifying whether a compact
* @param rsqlParam * or a full representation shall be returned
* the search parameter in the request URL, syntax
* {@code q=distributionSet.id==1}
* @param representationModeParam
* the representation mode parameter specifying whether a compact
* or a full representation shall be returned
* @return a list of all actions for a defined or default page request with * @return a list of all actions for a defined or default page request with
* status OK. The response is always paged. In any failure the * status OK. The response is always paged. In any failure the
* 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies.", "changed (i.e. read-only) or data volume restriction applies.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -110,24 +105,23 @@ public interface MgmtActionRestApi {
* its <code>actionId</code>. * its <code>actionId</code>.
* *
* @param actionId The ID of the requested action * @param actionId The ID of the requested action
*
* @return the {@link MgmtAction} * @return the {@link MgmtAction}
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "404", description = "Target not found.", @ApiResponse(responseCode = "404", description = "Target not found.",
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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts" + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts" +
" and the client has to wait another second.", " 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)))
}) })
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}", produces = { @GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })

View File

@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.GetMapping;
@Tag(name = "Basic Authentication", description = "API for basic auth user validation.") @Tag(name = "Basic Authentication", description = "API for basic auth user validation.")
// no request mapping specified here to avoid CVE-2021-22044 in Feign client // no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtBasicAuthRestApi { public interface MgmtBasicAuthRestApi {
/** /**
* Handles the GET request of basic auth. * Handles the GET request of basic auth.
* *

View File

@@ -45,19 +45,15 @@ public interface MgmtDistributionSetTagRestApi {
/** /**
* Handles the GET request of retrieving all DistributionSet tags. * Handles the GET request of retrieving all DistributionSet tags.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of DistributionSet tags for pagination,
* the offset of list of DistributionSet tags for pagination, * might not be present in the rest request then default value
* might not be present in the rest request then default value * will be applied
* will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
* @return a list of all target tags for a defined or default page request * @return a list of all target tags for a defined or default page request
* with status OK. The response is always paged. In any failure the * with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response. * JsonResponseExceptionHandler is handling the response.
@@ -65,22 +61,22 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING, produces = { @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -112,30 +108,29 @@ public interface MgmtDistributionSetTagRestApi {
* Handles the GET request of retrieving a single distribution set tag. * Handles the GET request of retrieving a single distribution set tag.
* *
* @param distributionsetTagId the ID of the distribution set tag to retrieve * @param distributionsetTagId the ID of the distribution set tag to retrieve
*
* @return a single distribution set tag with status OK. * @return a single distribution set tag with status OK.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Tag not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ "/{distributionsetTagId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) + "/{distributionsetTagId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -145,8 +140,7 @@ public interface MgmtDistributionSetTagRestApi {
* Handles the POST request of creating new distribution set tag. The * Handles the POST request of creating new distribution set tag. The
* request body must always be a list of tags. * request body must always be a list of tags.
* *
* @param tags * @param tags the distribution set tags to be created.
* the distribution set tags to be created.
* @return In case all modules could successful created the ResponseEntity * @return In case all modules could successful created the ResponseEntity
* with status code 201 - Created. The Response Body contains the * with status code 201 - Created. The Response Body contains the
* created distribution set tags but without details. * created distribution set tags but without details.
@@ -154,115 +148,110 @@ 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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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_TAG_V1_REQUEST_MAPPING, consumes = { @PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING, 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 })
ResponseEntity<List<MgmtTag>> createDistributionSetTags(List<MgmtTagRequestBodyPut> tags); ResponseEntity<List<MgmtTag>> createDistributionSetTags(List<MgmtTagRequestBodyPut> tags);
/** /**
*
* Handles the PUT request of updating a single distribution set tag. * Handles the PUT request of updating a single distribution set tag.
* *
* @param distributionsetTagId * @param distributionsetTagId the ID of the distribution set tag
* the ID of the distribution set tag * @param restDSTagRest the request body to be updated
* @param restDSTagRest
* the request body to be updated
* @return status OK if update is successful and the updated distribution * @return status OK if update is successful and the updated distribution
* set tag. * set tag.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Tag not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING @PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ "/{distributionsetTagId}", consumes = { MediaTypes.HAL_JSON_VALUE, + "/{distributionsetTagId}", 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 }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTag> updateDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId, ResponseEntity<MgmtTag> updateDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId,
MgmtTagRequestBodyPut restDSTagRest); MgmtTagRequestBodyPut restDSTagRest);
/** /**
* Handles the DELETE request for a single distribution set tag. * Handles the DELETE request for a single distribution set tag.
* *
* @param distributionsetTagId * @param distributionsetTagId the ID of the distribution set tag
* the ID of the distribution set tag
* @return status OK if delete as successfully. * @return status OK if delete as successfully.
*
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Tag not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@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);
@@ -271,48 +260,42 @@ public interface MgmtDistributionSetTagRestApi {
* Handles the GET request of retrieving all assigned distribution sets by * Handles the GET request of retrieving all assigned distribution sets by
* the given tag id. * the given tag id.
* *
* @param distributionsetTagId * @param distributionsetTagId the ID of the distribution set tag
* the ID of the distribution set tag * @param pagingOffsetParam the offset of list of target tags for pagination, might not be
* @param pagingOffsetParam * present in the rest request then default value will be applied
* the offset of list of target tags for pagination, might not be * @param pagingLimitParam the limit of the paged request, might not be present in the
* present in the rest request then default value will be applied * rest request then default value will be applied
* @param pagingLimitParam * @param sortParam the sorting parameter in the request URL, syntax
* the limit of the paged request, might not be present in the * {@code field:direction, field:direction}
* rest request then default value will be applied * @param rsqlParam the search parameter in the request URL, syntax
* @param sortParam * {@code q=name==abc}
* the sorting parameter in the request URL, syntax
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return the list of assigned distribution sets. * @return the list of assigned distribution sets.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Tag not found", @ApiResponse(responseCode = "404", description = "Distribution Set Tag not found",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING, produces = { + MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtDistributionSet>> getAssignedDistributionSets( ResponseEntity<PagedList<MgmtDistributionSet>> getAssignedDistributionSets(
@PathVariable("distributionsetTagId") Long distributionsetTagId, @PathVariable("distributionsetTagId") Long distributionsetTagId,
@RequestParam( @RequestParam(
@@ -343,7 +326,6 @@ public interface MgmtDistributionSetTagRestApi {
* *
* @param distributionsetTagId the ID of the distribution set tag to retrieve * @param distributionsetTagId the ID of the distribution set tag to retrieve
* @param distributionsetId the distribution sets ids to be assigned * @param distributionsetId the distribution sets ids to be assigned
*
* @return the list of assigned distribution set. * @return the list of assigned distribution set.
*/ */
@Operation(summary = "Assign distribution set to the given tag id", @Operation(summary = "Assign distribution set to the given tag id",
@@ -433,24 +415,24 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Tag not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@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_DISTRIBUTIONSETS_REQUEST_MAPPING + "/{distributionsetId}")
@@ -493,18 +475,15 @@ public interface MgmtDistributionSetTagRestApi {
@PathVariable("distributionsetTagId") Long distributionsetTagId, @PathVariable("distributionsetTagId") Long distributionsetTagId,
@RequestBody List<Long> distributionsetId); @RequestBody List<Long> distributionsetId);
/** /**
* Handles the POST request to toggle the assignment of distribution sets by * Handles the POST request to toggle the assignment of distribution sets by
* the given tag id. * the given tag id.
* *
* @deprecated since 0.6.0 with toggle assigment deprecation * @param distributionsetTagId the ID of the distribution set tag to retrieve
* @param distributionsetTagId * @param assignedDSRequestBodies list of distribution set ids to be toggled
* the ID of the distribution set tag to retrieve
* @param assignedDSRequestBodies
* list of distribution set ids to be toggled
*
* @return the list of assigned distribution sets and unassigned * @return the list of assigned distribution sets and unassigned
* distribution sets. * distribution sets.
* @deprecated since 0.6.0 with toggle assigment deprecation
*/ */
@Operation(summary = "[DEPRECATED] Toggle the assignment of distribution sets by the given tag id", @Operation(summary = "[DEPRECATED] Toggle the assignment of distribution sets by the given tag id",
description = "Handles the POST request of toggle distribution assignment. The request body must " + description = "Handles the POST request of toggle distribution assignment. The request body must " +
@@ -543,10 +522,10 @@ public interface MgmtDistributionSetTagRestApi {
/** /**
* Handles the POST request to assign distribution sets to the given tag id. * Handles the POST request to assign distribution sets to the given tag id.
* *
* @deprecated since 0.6.0 in favor or assign by ds ids
* @param distributionsetTagId the ID of the distribution set tag to retrieve * @param distributionsetTagId the ID of the distribution set tag to retrieve
* @param assignedDSRequestBodies list of distribution sets ids to be assigned * @param assignedDSRequestBodies list of distribution sets ids to be assigned
* @return the list of assigned distribution set. * @return the list of assigned distribution set.
* @deprecated since 0.6.0 in favor or assign by ds ids
*/ */
@Operation(summary = "[DEPRECATED] Assign distribution sets to the given tag id", @Operation(summary = "[DEPRECATED] Assign distribution sets to the given tag id",
description = "Handles the POST request of distribution assignment. Already assigned distribution will " + description = "Handles the POST request of distribution assignment. Already assigned distribution will " +

View File

@@ -44,19 +44,14 @@ public interface MgmtDistributionSetTypeRestApi {
/** /**
* Handles the GET request of retrieving all DistributionSetTypes. * Handles the GET request of retrieving all DistributionSetTypes.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of modules for pagination, might not be
* the offset of list of modules for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return a list of all DistributionSetType for a defined or default page * @return a list of all DistributionSetType for a defined or default page
* request with status OK. The response is always paged. In any * request with status OK. The response is always paged. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -65,22 +60,22 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING, produces = { @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -112,32 +107,30 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the GET request of retrieving a single DistributionSetType * Handles the GET request of retrieving a single DistributionSetType
* within. * within.
* *
* @param distributionSetTypeId * @param distributionSetTypeId the ID of the DS type to retrieve
* the ID of the DS type to retrieve
*
* @return a single DS type with status OK. * @return a single DS type with status OK.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING
+ "/{distributionSetTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) + "/{distributionSetTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -147,32 +140,30 @@ public interface MgmtDistributionSetTypeRestApi {
/** /**
* Handles the DELETE request for a single Distribution Set Type. * Handles the DELETE request for a single Distribution Set Type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId the ID of the module to retrieve
* the ID of the module to retrieve
* @return status OK if delete is successful. * @return status OK if delete is successful.
*
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@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);
@@ -180,44 +171,42 @@ public interface MgmtDistributionSetTypeRestApi {
/** /**
* Handles the PUT request of updating a Distribution Set Type. * Handles the PUT request of updating a Distribution Set Type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId the ID of the DS type in the URL
* the ID of the DS type in the URL * @param restDistributionSetType the DS type to be updated.
* @param restDistributionSetType
* the DS type to be updated.
* @return status OK if update is successful * @return status OK if update is successful
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING @PutMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING
+ "/{distributionSetTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE, + "/{distributionSetTypeId}", 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 }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSetType> updateDistributionSetType( ResponseEntity<MgmtDistributionSetType> updateDistributionSetType(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId, @PathVariable("distributionSetTypeId") Long distributionSetTypeId,
MgmtDistributionSetTypeRequestBodyPut restDistributionSetType); MgmtDistributionSetTypeRequestBodyPut restDistributionSetType);
@@ -226,8 +215,7 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the POST request of creating new DistributionSetTypes. The * Handles the POST request of creating new DistributionSetTypes. The
* request body must always be a list of types. * request body must always be a list of types.
* *
* @param distributionSetTypes * @param distributionSetTypes the modules to be created.
* the modules to be created.
* @return In case all modules could successful created the ResponseEntity * @return In case all modules could successful created the ResponseEntity
* with status code 201 - Created but without ResponseBody. In any * with status code 201 - Created but without ResponseBody. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -237,32 +225,32 @@ public interface MgmtDistributionSetTypeRestApi {
"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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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, consumes = { @PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING, 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 })
ResponseEntity<List<MgmtDistributionSetType>> createDistributionSetTypes( ResponseEntity<List<MgmtDistributionSetType>> createDistributionSetTypes(
List<MgmtDistributionSetTypeRequestBodyPost> distributionSetTypes); List<MgmtDistributionSetTypeRequestBodyPost> distributionSetTypes);
@@ -270,36 +258,35 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the GET request of retrieving the list of mandatory software * Handles the GET request of retrieving the list of mandatory software
* module types in that distribution set type. * module types in that distribution set type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType.
* @return Unpaged list of module types and OK in case of success. * @return Unpaged list of module types and OK in case of success.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleType>> getMandatoryModules( ResponseEntity<List<MgmtSoftwareModuleType>> getMandatoryModules(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId); @PathVariable("distributionSetTypeId") Long distributionSetTypeId);
@@ -307,34 +294,32 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the GET request of retrieving the single mandatory software * Handles the GET request of retrieving the single mandatory software
* module type in that distribution set type. * module type in that distribution set type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType. * @param softwareModuleTypeId of SoftwareModuleType.
* @param softwareModuleTypeId
* of SoftwareModuleType.
* @return Unpaged list of module types and OK in case of success. * @return Unpaged list of module types and OK in case of success.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
@@ -347,34 +332,32 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the GET request of retrieving the single optional software module * Handles the GET request of retrieving the single optional software module
* type in that distribution set type. * type in that distribution set type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType. * @param softwareModuleTypeId of SoftwareModuleType.
* @param softwareModuleTypeId
* of SoftwareModuleType.
* @return Unpaged list of module types and OK in case of success. * @return Unpaged list of module types and OK in case of success.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
@@ -387,36 +370,35 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the GET request of retrieving the list of optional software * Handles the GET request of retrieving the list of optional software
* module types in that distribution set type. * module types in that distribution set type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType.
* @return Unpaged list of module types and OK in case of success. * @return Unpaged list of module types and OK in case of success.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" @GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleType>> getOptionalModules( ResponseEntity<List<MgmtSoftwareModuleType>> getOptionalModules(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId); @PathVariable("distributionSetTypeId") Long distributionSetTypeId);
@@ -424,35 +406,32 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles DELETE request for removing a mandatory module from the * Handles DELETE request for removing a mandatory module from the
* DistributionSetType. * DistributionSetType.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType. * @param softwareModuleTypeId of the SoftwareModuleType to remove
* @param softwareModuleTypeId
* of the SoftwareModuleType to remove
*
* @return OK if the request was successful * @return OK if the request was successful
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" @DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}") + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}")
@@ -463,11 +442,8 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles DELETE request for removing an optional module from the * Handles DELETE request for removing an optional module from the
* DistributionSetType. * DistributionSetType.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType. * @param softwareModuleTypeId of the SoftwareModuleType to remove
* @param softwareModuleTypeId
* of the SoftwareModuleType to remove
*
* @return OK if the request was successful * @return OK if the request was successful
*/ */
@Operation(summary = "Delete an optional module from a Distribution Set Type", @Operation(summary = "Delete an optional module from a Distribution Set Type",
@@ -475,24 +451,24 @@ public interface MgmtDistributionSetTypeRestApi {
"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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/" @DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}") + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}")
@@ -503,11 +479,8 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the POST request for adding a mandatory software module type to a * Handles the POST request for adding a mandatory software module type to a
* distribution set type. * distribution set type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType. * @param smtId of the SoftwareModuleType to add
* @param smtId
* of the SoftwareModuleType to add
*
* @return OK if the request was successful * @return OK if the request was successful
*/ */
@Operation(summary = "Add mandatory Software Module Type to a Distribution Set Type", @Operation(summary = "Add mandatory Software Module Type to a Distribution Set Type",
@@ -515,34 +488,34 @@ public interface MgmtDistributionSetTypeRestApi {
"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")
@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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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, consumes = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> addMandatoryModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId, ResponseEntity<Void> addMandatoryModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
MgmtId smtId); MgmtId smtId);
@@ -550,11 +523,8 @@ public interface MgmtDistributionSetTypeRestApi {
* Handles the POST request for adding an optional software module type to a * Handles the POST request for adding an optional software module type to a
* distribution set type. * distribution set type.
* *
* @param distributionSetTypeId * @param distributionSetTypeId of the DistributionSetType.
* of the DistributionSetType. * @param smtId of the SoftwareModuleType to add
* @param smtId
* of the SoftwareModuleType to add
*
* @return OK if the request was successful * @return OK if the request was successful
*/ */
@Operation(summary = "Add optional Software Module Type to a Distribution Set Type", @Operation(summary = "Add optional Software Module Type to a Distribution Set Type",
@@ -562,34 +532,34 @@ public interface MgmtDistributionSetTypeRestApi {
"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")
@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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution Set Type not found.", @ApiResponse(responseCode = "404", description = "Distribution Set Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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, consumes = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> addOptionalModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId, ResponseEntity<Void> addOptionalModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
MgmtId smtId); MgmtId smtId);
} }

View File

@@ -30,7 +30,6 @@ public interface MgmtDownloadArtifactRestApi {
* *
* @param softwareModuleId of the parent SoftwareModule * @param softwareModuleId of the parent SoftwareModule
* @param artifactId of the related LocalArtifact * @param artifactId of the related LocalArtifact
*
* @return responseEntity with status ok if successful * @return responseEntity with status ok if successful
*/ */
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING

View File

@@ -27,13 +27,13 @@ public enum MgmtRepresentationMode {
this.mode = mode; this.mode = mode;
} }
public static Optional<MgmtRepresentationMode> fromValue(final String value) {
return Arrays.stream(MgmtRepresentationMode.values()).filter(v -> v.mode.equalsIgnoreCase(value)).findFirst();
}
@Override @Override
public String toString() { public String toString() {
return mode; return mode;
} }
public static Optional<MgmtRepresentationMode> fromValue(final String value) {
return Arrays.stream(MgmtRepresentationMode.values()).filter(v -> v.mode.equalsIgnoreCase(value)).findFirst();
}
} }

View File

@@ -32,13 +32,62 @@ public final class MgmtRestConstants {
* The base URL mapping of the SP rest resources. * The base URL mapping of the SP rest resources.
*/ */
public static final String BASE_V1_REQUEST_MAPPING = BASE_REST_MAPPING + "/v1"; public static final String BASE_V1_REQUEST_MAPPING = BASE_REST_MAPPING + "/v1";
/**
* The software module URL mapping rest resource.
*/
public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";
public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + BASE_SYSTEM_MAPPING;
/**
* The target URL mapping rest resource.
*/
public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets";
/**
* The tag URL mapping rest resource.
*/
public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags";
/**
* The target type URL mapping rest resource.
*/
public static final String TARGETTYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettypes";
/**
* The tag URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
+ "/distributionsettags";
/**
* The target URL mapping rest resource.
*/
public static final String TARGET_FILTER_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targetfilters";
/**
* The action URL mapping rest resource.
*/
public static final String ACTION_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/actions";
/**
* The software module type URL mapping rest resource.
*/
public static final String SOFTWAREMODULETYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremoduletypes";
/**
* The distributon set base resource.
*/
public static final String DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
+ "/distributionsettypes";
/**
* The software module URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/distributionsets";
/**
* The rollout URL mapping rest resource.
*/
public static final String ROLLOUT_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/rollouts";
/**
* The basic authentication validation mapping
*/
public static final String AUTH_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/userinfo";
/** /**
* String representation of * String representation of
* {@link #REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE}. * {@link #REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE}.
*/ */
public static final String REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT = "50"; public static final String REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT = "50";
/** /**
* The default limit parameter in case the limit parameter is not present in * The default limit parameter in case the limit parameter is not present in
* the request. * the request.
@@ -47,44 +96,30 @@ public final class MgmtRestConstants {
*/ */
public static final int REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE = Integer public static final int REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE = Integer
.parseInt(REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT); .parseInt(REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT);
/**
* The software module URL mapping rest resource.
*/
public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";
/** /**
* The base URL mapping for the spring acuator management context path. * The base URL mapping for the spring acuator management context path.
*/ */
public static final String BASE_SYSTEM_MAPPING = "/system"; public static final String BASE_SYSTEM_MAPPING = "/system";
/** /**
* URL mapping for system admin operations. * URL mapping for system admin operations.
*/ */
public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin"; public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin";
public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + BASE_SYSTEM_MAPPING;
/** /**
* The target URL mapping, href link for assigned target type. * The target URL mapping, href link for assigned target type.
*/ */
public static final String TARGET_V1_ASSIGNED_TARGET_TYPE = "targetType"; public static final String TARGET_V1_ASSIGNED_TARGET_TYPE = "targetType";
/** /**
* The target URL mapping, href link for autoConfirm state of a target. * The target URL mapping, href link for autoConfirm state of a target.
*/ */
public static final String TARGET_V1_AUTO_CONFIRM = "autoConfirm"; public static final String TARGET_V1_AUTO_CONFIRM = "autoConfirm";
/** /**
* The target URL mapping, href link activate auto-confirm on a target. * The target URL mapping, href link activate auto-confirm on a target.
*/ */
public static final String TARGET_V1_ACTIVATE_AUTO_CONFIRM = "activate"; public static final String TARGET_V1_ACTIVATE_AUTO_CONFIRM = "activate";
/** /**
* The target URL mapping, href link deactivate auto-confirm on a target. * The target URL mapping, href link deactivate auto-confirm on a target.
*/ */
public static final String TARGET_V1_DEACTIVATE_AUTO_CONFIRM = "deactivate"; public static final String TARGET_V1_DEACTIVATE_AUTO_CONFIRM = "deactivate";
/** /**
* The target URL mapping, href link for assigned distribution set. * The target URL mapping, href link for assigned distribution set.
*/ */
@@ -113,58 +148,22 @@ public final class MgmtRestConstants {
* The target URL mapping, href link for a rollout. * The target URL mapping, href link for a rollout.
*/ */
public static final String TARGET_V1_ROLLOUT = "rollout"; public static final String TARGET_V1_ROLLOUT = "rollout";
/**
* The target URL mapping rest resource.
*/
public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets";
/**
* The tag URL mapping rest resource.
*/
public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags";
/** /**
* 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_TYPE_V1_REQUEST_MAPPING = "/{targetId}/targettype";
/**
* The target type URL mapping rest resource.
*/
public static final String TARGETTYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettypes";
/** /**
* 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 TARGETTYPE_V1_DS_TYPES = "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_TARGETS_REQUEST_MAPPING = "/{targetTagId}/assigned";
/**
* The tag URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
+ "/distributionsettags";
/**
* The target URL mapping rest resource.
*/
public static final String TARGET_FILTER_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targetfilters";
/** /**
* 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_DISTRIBUTIONSETS_REQUEST_MAPPING = "/{distributionsetTagId}/assigned";
/**
* The action URL mapping rest resource.
*/
public static final String ACTION_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/actions";
/** /**
* The default offset parameter in case the offset parameter is not present * The default offset parameter in case the offset parameter is not present
* in the request. * in the request.
@@ -172,7 +171,6 @@ public final class MgmtRestConstants {
* @see #REQUEST_PARAMETER_PAGING_OFFSET * @see #REQUEST_PARAMETER_PAGING_OFFSET
*/ */
public static final String REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET = "0"; public static final String REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET = "0";
/** /**
* The default offset parameter in case the offset parameter is not present * The default offset parameter in case the offset parameter is not present
* in the request. * in the request.
@@ -181,7 +179,6 @@ public final class MgmtRestConstants {
*/ */
public static final int REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET_VALUE = Integer public static final int REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET_VALUE = Integer
.parseInt(REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET); .parseInt(REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET);
/** /**
* Limit http parameter for the limitation of returned values for a paged * Limit http parameter for the limitation of returned values for a paged
* request. * request.
@@ -191,12 +188,10 @@ public final class MgmtRestConstants {
* The maximum limit of entities returned by rest resources. * The maximum limit of entities returned by rest resources.
*/ */
public static final int REQUEST_PARAMETER_PAGING_MAX_LIMIT = 500; public static final int REQUEST_PARAMETER_PAGING_MAX_LIMIT = 500;
/** /**
* Paging http parameter for the offset for a paged request. * Paging http parameter for the offset for a paged request.
*/ */
public static final String REQUEST_PARAMETER_PAGING_OFFSET = "offset"; public static final String REQUEST_PARAMETER_PAGING_OFFSET = "offset";
/** /**
* The request parameter for sorting. The value of the sort parameter must * The request parameter for sorting. The value of the sort parameter must
* be in the following pattern. Example: * be in the following pattern. Example:
@@ -204,78 +199,40 @@ public final class MgmtRestConstants {
* field_3:ASC * field_3:ASC
*/ */
public static final String REQUEST_PARAMETER_SORTING = "sort"; public static final String REQUEST_PARAMETER_SORTING = "sort";
/** /**
* The request parameter for searching. The value of the search parameter * The request parameter for searching. The value of the search parameter
* must be in the FIQL syntax. * must be in the FIQL syntax.
*/ */
public static final String REQUEST_PARAMETER_SEARCH = "q"; public static final String REQUEST_PARAMETER_SEARCH = "q";
/** /**
* The request parameter for specifying the representation mode. The value * The request parameter for specifying the representation mode. The value
* of this parameter can either be "full" or "compact". * of this parameter can either be "full" or "compact".
*/ */
public static final String REQUEST_PARAMETER_REPRESENTATION_MODE = "representation"; public static final String REQUEST_PARAMETER_REPRESENTATION_MODE = "representation";
/** /**
* The default representation mode. * The default representation mode.
*/ */
public static final String REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT = "compact"; public static final String REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT = "compact";
/**
* The software module type URL mapping rest resource.
*/
public static final String SOFTWAREMODULETYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremoduletypes";
/**
* The distributon set base resource.
*/
public static final String DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
+ "/distributionsettypes";
/**
* The software module URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/distributionsets";
/**
* The rollout URL mapping rest resource.
*/
public static final String ROLLOUT_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/rollouts";
/** /**
* Request parameter for async * Request parameter for async
*/ */
public static final String REQUEST_PARAMETER_ASYNC = "async"; public static final String REQUEST_PARAMETER_ASYNC = "async";
/** /**
* The target URL mapping, href link for artifact download. * The target URL mapping, href link for artifact download.
*/ */
public static final String SOFTWAREMODULE_V1_ARTIFACT = "artifacts"; public static final String SOFTWAREMODULE_V1_ARTIFACT = "artifacts";
/** /**
* The target URL mapping, href link for software module access. * The target URL mapping, href link for software module access.
*/ */
public static final String DISTRIBUTIONSET_V1_MODULE = "modules"; public static final String DISTRIBUTIONSET_V1_MODULE = "modules";
/** /**
* 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 DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES = "optionalmodules";
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES = "mandatorymodules"; public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES = "mandatorymodules";
public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES = "optionalmoduletypes"; public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES = "optionalmoduletypes";
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes"; public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes";
/**
* The basic authentication validation mapping
*/
public static final String AUTH_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/userinfo";
/** /**
* Request parameter if the artifact url handler should be used * Request parameter if the artifact url handler should be used
*/ */

View File

@@ -43,21 +43,16 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the GET request of retrieving all rollouts. * Handles the GET request of retrieving all rollouts.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of rollouts for pagination, might not be
* the offset of list of rollouts for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction} * @param representationModeParam the representation mode parameter specifying whether a compact
* @param rsqlParam * or a full representation shall be returned
* the search parameter in the request URL, syntax
* {@code q=name==abc}
* @param representationModeParam
* the representation mode parameter specifying whether a compact
* or a full representation shall be returned
* @return a list of all rollouts for a defined or default page request with * @return a list of all rollouts for a defined or default page request with
* status OK. The response is always paged. In any failure the * status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response. * JsonResponseExceptionHandler is handling the response.
@@ -65,22 +60,22 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -114,31 +109,30 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the GET request of retrieving a single rollout. * Handles the GET request of retrieving a single rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to retrieve
* the ID of the rollout to retrieve
* @return a single rollout with status OK. * @return a single rollout with status OK.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Rollout not found.", @ApiResponse(responseCode = "404", description = "Rollout not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}", produces = { @GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -147,8 +141,7 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the POST request for creating rollout. * Handles the POST request for creating rollout.
* *
* @param rolloutCreateBody * @param rolloutCreateBody the rollout body to be created.
* the rollout body to be created.
* @return In case rollout could successful created the ResponseEntity with * @return In case rollout could successful created the ResponseEntity with
* status code 201 with the successfully created rollout. In any * status code 201 with the successfully created rollout. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -157,39 +150,38 @@ public interface MgmtRolloutRestApi {
@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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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, consumes = { MediaTypes.HAL_JSON_VALUE, @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtRolloutResponseBody> create(MgmtRolloutRestRequestBodyPost rolloutCreateBody); ResponseEntity<MgmtRolloutResponseBody> create(MgmtRolloutRestRequestBodyPost rolloutCreateBody);
/** /**
* Handles the POST request for creating rollout. * Handles the POST request for creating rollout.
* *
* @param rolloutUpdateBody * @param rolloutUpdateBody the rollout body with details for update.
* the rollout body with details for update.
* @return In case rollout could successful updated the ResponseEntity with * @return In case rollout could successful updated the ResponseEntity with
* status code 200 with the successfully created rollout. In any * status code 200 with the successfully created rollout. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -231,10 +223,8 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the request for approving a rollout. * Handles the request for approving a rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be approved.
* the ID of the rollout to be approved. * @param remark an optional remark on the approval decision
* @param remark
* an optional remark on the approval decision
* @return OK response (200) if rollout is approved now. In case of any * @return OK response (200) if rollout is approved now. In case of any
* exception the corresponding errors occur. * exception the corresponding errors occur.
*/ */
@@ -243,22 +233,22 @@ public interface MgmtRolloutRestApi {
"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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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}/approve", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/approve", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -268,10 +258,8 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the request for denying the approval of a rollout. * Handles the request for denying the approval of a rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be denied.
* the ID of the rollout to be denied. * @param remark an optional remark on the denial decision
* @param remark
* an optional remark on the denial decision
* @return OK response (200) if rollout is denied now. In case of any * @return OK response (200) if rollout is denied now. In case of any
* exception the corresponding errors occur. * exception the corresponding errors occur.
*/ */
@@ -279,22 +267,22 @@ public interface MgmtRolloutRestApi {
"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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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}/deny", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deny", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -304,30 +292,29 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the POST request for starting a rollout. * Handles the POST request for starting a rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be started.
* the ID of the rollout to be started.
* @return OK response (200) if rollout could be started. In case of any * @return OK response (200) if rollout could be started. In case of any
* exception the corresponding errors occur. * exception the corresponding errors occur.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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}/start", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/start", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -336,30 +323,29 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the POST request for pausing a rollout. * Handles the POST request for pausing a rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be paused.
* the ID of the rollout to be paused.
* @return OK response (200) if rollout could be paused. In case of any * @return OK response (200) if rollout could be paused. In case of any
* exception the corresponding errors occur. * exception the corresponding errors occur.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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}/pause", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/pause", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -368,32 +354,31 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the DELETE request for deleting a rollout. * Handles the DELETE request for deleting a rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be deleted.
* the ID of the rollout to be deleted.
* @return OK response (200) if rollout could be deleted. In case of any * @return OK response (200) if rollout could be deleted. In case of any
* exception the corresponding errors occur. * exception the corresponding errors occur.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Rollout not found.", @ApiResponse(responseCode = "404", description = "Rollout not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}", produces = { @DeleteMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -402,30 +387,29 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the POST request for resuming a rollout. * Handles the POST request for resuming a rollout.
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be resumed.
* the ID of the rollout to be resumed.
* @return OK response (200) if rollout could be resumed. In case of any * @return OK response (200) if rollout could be resumed. In case of any
* exception the corresponding errors occur. * exception the corresponding errors occur.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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}/resume", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/resume", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -435,23 +419,17 @@ public interface MgmtRolloutRestApi {
* Handles the GET request of retrieving all rollout groups referred to a * Handles the GET request of retrieving all rollout groups referred to a
* rollout. * rollout.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of rollout groups for pagination, might not
* the offset of list of rollout groups for pagination, might not * be present in the rest request then default value will be
* be present in the rest request then default value will be * applied
* applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction} * @param representationModeParam the representation mode parameter specifying whether a compact
* @param rsqlParam * or a full representation shall be returned
* the search parameter in the request URL, syntax
* {@code q=name==abc}
* @param representationModeParam
* the representation mode parameter specifying whether a compact
* or a full representation shall be returned
*
* @return a list of all rollout groups referred to a rollout for a defined * @return a list of all rollout groups referred to a rollout for a defined
* or default page request with status OK. The response is always * or default page request with status OK. The response is always
* paged. In any failure the JsonResponseExceptionHandler is * paged. In any failure the JsonResponseExceptionHandler is
@@ -460,24 +438,24 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Rollout not found.", @ApiResponse(responseCode = "404", description = "Rollout not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups", produces = { @GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -511,60 +489,52 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the GET request for retrieving a single rollout group. * Handles the GET request for retrieving a single rollout group.
* *
* @param rolloutId * @param rolloutId the rolloutId to retrieve the group from
* the rolloutId to retrieve the group from * @param groupId the groupId to retrieve the rollout group
* @param groupId
* the groupId to retrieve the rollout group
* @return the OK response containing the MgmtRolloutGroupResponseBody * @return the OK response containing the MgmtRolloutGroupResponseBody
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Rollout not found.", @ApiResponse(responseCode = "404", description = "Rollout not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING
+ "/{rolloutId}/deploygroups/{groupId}", produces = { MediaTypes.HAL_JSON_VALUE, + "/{rolloutId}/deploygroups/{groupId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtRolloutGroupResponseBody> getRolloutGroup(@PathVariable("rolloutId") Long rolloutId, ResponseEntity<MgmtRolloutGroupResponseBody> getRolloutGroup(@PathVariable("rolloutId") Long rolloutId,
@PathVariable("groupId") Long groupId); @PathVariable("groupId") Long groupId);
/** /**
* Retrieves all targets related to a specific rollout group. * Retrieves all targets related to a specific rollout group.
* *
* @param rolloutId * @param rolloutId the ID of the rollout
* the ID of the rollout * @param groupId the ID of the rollout group
* @param groupId * @param pagingOffsetParam the offset of list of rollout groups for pagination, might not
* the ID of the rollout group * be present in the rest request then default value will be
* @param pagingOffsetParam * applied
* the offset of list of rollout groups for pagination, might not * @param pagingLimitParam the limit of the paged request, might not be present in the
* be present in the rest request then default value will be * rest request then default value will be applied
* applied * @param sortParam the sorting parameter in the request URL, syntax
* @param pagingLimitParam * {@code field:direction, field:direction}
* the limit of the paged request, might not be present in the * @param rsqlParam the search parameter in the request URL, syntax
* rest request then default value will be applied * {@code q=name==abc}
* @param sortParam
* the sorting parameter in the request URL, syntax
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
* @return a paged list of targets related to a specific rollout and rollout * @return a paged list of targets related to a specific rollout and rollout
* group. * group.
*/ */
@@ -572,28 +542,28 @@ public interface MgmtRolloutRestApi {
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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Rollout not found.", @ApiResponse(responseCode = "404", description = "Rollout not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING
+ "/{rolloutId}/deploygroups/{groupId}/targets", produces = { MediaTypes.HAL_JSON_VALUE, + "/{rolloutId}/deploygroups/{groupId}/targets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(@PathVariable("rolloutId") Long rolloutId, ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(@PathVariable("rolloutId") Long rolloutId,
@PathVariable("groupId") Long groupId, @PathVariable("groupId") Long groupId,
@RequestParam( @RequestParam(
@@ -623,30 +593,29 @@ public interface MgmtRolloutRestApi {
* Handles the POST request to force trigger processing next group of a * Handles the POST request to force trigger processing next group of a
* rollout even success threshold isn't yet met * rollout even success threshold isn't yet met
* *
* @param rolloutId * @param rolloutId the ID of the rollout to trigger next group.
* the ID of the rollout to trigger next group.
* @return OK response (200). In case of any exception the corresponding * @return OK response (200). In case of any exception the corresponding
* errors occur. * errors occur.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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}/triggerNextGroup", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/triggerNextGroup", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -655,35 +624,34 @@ public interface MgmtRolloutRestApi {
/** /**
* Handles the POST request to retry a rollout * Handles the POST request to retry a rollout
* *
* @param rolloutId * @param rolloutId the ID of the rollout to be retried.
* the ID of the rollout to be retried.
* @return OK response (200). In case of any exception the corresponding * @return OK response (200). In case of any exception the corresponding
* errors occur. * errors occur.
*/ */
@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")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Rollout not found.", @ApiResponse(responseCode = "404", description = "Rollout not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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", produces = { @PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/retry", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE}) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtRolloutResponseBody> retryRollout(@PathVariable("rolloutId") final Long rolloutId); ResponseEntity<MgmtRolloutResponseBody> retryRollout(@PathVariable("rolloutId") final Long rolloutId);
} }

View File

@@ -55,7 +55,6 @@ 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 * @return In case all sets could successful be created the ResponseEntity
* with status code 201 - Created but without ResponseBody. In any * with status code 201 - Created but without ResponseBody. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -63,30 +62,30 @@ public interface MgmtSoftwareModuleRestApi {
*/ */
@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")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found", 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.", @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.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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.SOFTWAREMODULE_V1_REQUEST_MAPPING @PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = { + "/{softwareModuleId}/artifacts", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtArtifact> uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, ResponseEntity<MgmtArtifact> uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestPart("file") final MultipartFile file, @RequestPart("file") final MultipartFile file,
@RequestParam(value = "filename", required = false) final String optionalFileName, @RequestParam(value = "filename", required = false) final String optionalFileName,
@@ -98,9 +97,7 @@ public interface MgmtSoftwareModuleRestApi {
* Handles the GET request of retrieving all meta data of artifacts assigned * Handles the GET request of retrieving all meta data of artifacts assigned
* to a software module. * to a software module.
* *
* @param softwareModuleId * @param softwareModuleId of the parent SoftwareModule
* of the parent SoftwareModule
*
* @return a list of all artifacts for a defined or default page request * @return a list of all artifacts for a defined or default page request
* with status OK. The response is always paged. In any failure the * with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response. * JsonResponseExceptionHandler is handling the response.
@@ -109,28 +106,28 @@ public interface MgmtSoftwareModuleRestApi {
description = "Handles the GET request of retrieving all meta data of artifacts assigned to a " + description = "Handles the GET request of retrieving all meta data of artifacts assigned to a " +
"software module. Required Permission: READ_REPOSITORY") "software module. Required Permission: 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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found ", @ApiResponse(responseCode = "404", description = "Software Module not found ",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts", produces = { MediaTypes.HAL_JSON_VALUE, + "/{softwareModuleId}/artifacts", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtArtifact>> getArtifacts(@PathVariable("softwareModuleId") final Long softwareModuleId, ResponseEntity<List<MgmtArtifact>> getArtifacts(@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT) String representationModeParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT) String representationModeParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_USE_ARTIFACT_URL_HANDLER, required = false) final Boolean useArtifactUrlHandler); @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_USE_ARTIFACT_URL_HANDLER, required = false) final Boolean useArtifactUrlHandler);
@@ -141,67 +138,63 @@ public interface MgmtSoftwareModuleRestApi {
* *
* @param softwareModuleId of the parent SoftwareModule * @param softwareModuleId of the parent SoftwareModule
* @param artifactId of the related LocalArtifact * @param artifactId of the related LocalArtifact
*
* @return responseEntity with status ok if successful * @return responseEntity with status ok if successful
*/ */
@Operation(summary = "Return single Artifact meta data", description = "Handles the GET request of retrieving a single Artifact meta data request. Required Permission: READ_REPOSITORY") @Operation(summary = "Return single Artifact meta data", description = "Handles the GET request of retrieving a single Artifact meta data request. Required Permission: 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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found.", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts/{artifactId}", produces = { MediaTypes.HAL_JSON_VALUE, + "/{softwareModuleId}/artifacts/{artifactId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@ResponseBody ResponseEntity<MgmtArtifact> getArtifact( @ResponseBody
ResponseEntity<MgmtArtifact> getArtifact(
@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("artifactId") final Long artifactId, @PathVariable("artifactId") final Long artifactId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_USE_ARTIFACT_URL_HANDLER, required = false) @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_USE_ARTIFACT_URL_HANDLER, required = false) final Boolean useArtifactUrlHandler);
final Boolean useArtifactUrlHandler);
/** /**
* Handles the DELETE request for a single SoftwareModule. * Handles the DELETE request for a single SoftwareModule.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the module that has the artifact
* the ID of the module that has the artifact * @param artifactId of the artifact to be deleted
* @param artifactId
* of the artifact to be deleted
*
* @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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found.", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts/{artifactId}") + "/{softwareModuleId}/artifacts/{artifactId}")
@@ -212,41 +205,36 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Handles the GET request of retrieving all softwaremodules. * Handles the GET request of retrieving all softwaremodules.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of modules for pagination, might not be
* the offset of list of modules for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return a list of all modules for a defined or default page request with * @return a list of all modules for a defined or default page request with
* status OK. The response is always paged. In any failure the * status OK. The response is always paged. In any failure the
* 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -277,31 +265,29 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Handles the GET request of retrieving a single software module. * Handles the GET request of retrieving a single software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the module to retrieve
* the ID of the module to retrieve
*
* @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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found ", @ApiResponse(responseCode = "404", description = "Software Module not found ",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}", produces = { @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -311,8 +297,7 @@ public interface MgmtSoftwareModuleRestApi {
* Handles the POST request of creating new softwaremodules. The request * Handles the POST request of creating new softwaremodules. The request
* body must always be a list of modules. * body must always be a list of modules.
* *
* @param softwareModules * @param softwareModules the modules to be created.
* the modules to be created.
* @return In case all modules could successful created the ResponseEntity * @return In case all modules could successful created the ResponseEntity
* with status code 201 - Created but without ResponseBody. In any * with status code 201 - Created but without ResponseBody. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -320,70 +305,68 @@ 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") @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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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.SOFTWAREMODULE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE, @PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModule>> createSoftwareModules( ResponseEntity<List<MgmtSoftwareModule>> createSoftwareModules(
final List<MgmtSoftwareModuleRequestBodyPost> softwareModules); final List<MgmtSoftwareModuleRequestBodyPost> softwareModules);
/** /**
* Handles the PUT request of updating a software module. * Handles the PUT request of updating a software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the software module in the URL
* the ID of the software module in the URL * @param restSoftwareModule the modules to be updated.
* @param restSoftwareModule
* the modules to be updated.
* @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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found.", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}", consumes = { @PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}", 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 })
ResponseEntity<MgmtSoftwareModule> updateSoftwareModule( ResponseEntity<MgmtSoftwareModule> updateSoftwareModule(
@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("softwareModuleId") final Long softwareModuleId,
final MgmtSoftwareModuleRequestBodyPut restSoftwareModule); final MgmtSoftwareModuleRequestBodyPut restSoftwareModule);
@@ -391,30 +374,28 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Handles the DELETE request for a single software module. * Handles the DELETE request for a single software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the module to retrieve
* the ID of the module to retrieve
* @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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found.", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}") @DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}")
ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId); ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId);
@@ -422,47 +403,42 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Gets a paged list of meta data for a software module. * Gets a paged list of meta data for a software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the software module for the meta data
* the ID of the software module for the meta data * @param pagingOffsetParam the offset of list of meta data for pagination, might not be
* @param pagingOffsetParam * present in the rest request then default value will be applied
* the offset of list of meta data for pagination, might not be * @param pagingLimitParam the limit of the paged request, might not be present in the
* present in the rest request then default value will be applied * rest request then default value will be applied
* @param pagingLimitParam * @param sortParam the sorting parameter in the request URL, syntax
* the limit of the paged request, might not be present in the * {@code field:direction, field:direction}
* rest request then default value will be applied * @param rsqlParam the search parameter in the request URL, syntax
* @param sortParam * {@code q=key==abc}
* the sorting parameter in the request URL, syntax
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=key==abc}
* @return status OK if get request is successful with the paged list of * @return status OK if get request is successful with the paged list of
* meta data * meta data
*/ */
@Operation(summary = "Return meta data for a Software Module", description = "Get a paged list of meta data for a software module. Required Permission: READ_REPOSITORY") @Operation(summary = "Return meta data for a Software Module", description = "Get a paged list of meta data for a software module. Required Permission: 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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found ", @ApiResponse(responseCode = "404", description = "Software Module not found ",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE, + "/{softwareModuleId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtSoftwareModuleMetadata>> getMetadata( ResponseEntity<PagedList<MgmtSoftwareModuleMetadata>> getMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestParam( @RequestParam(
@@ -491,37 +467,35 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Gets a single meta data value for a specific key of a software module. * Gets a single meta data value for a specific key of a software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the software module to get the meta data from
* the ID of the software module to get the meta data from * @param metadataKey the key of the meta data entry to retrieve the value from
* @param metadataKey
* the key of the meta data entry to retrieve the value from
* @return status OK if get request is successful with the value of the meta * @return status OK if get request is successful with the value of the meta
* data * data
*/ */
@Operation(summary = "Return single meta data value for a specific key of a Software Module", description = "Get a single meta data value for a meta data key. Required Permission: READ_REPOSITORY") @Operation(summary = "Return single meta data value for a specific key of a Software Module", description = "Get a single meta data value for a meta data key. Required Permission: 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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found ", @ApiResponse(responseCode = "404", description = "Software Module not found ",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE, + "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleMetadata> getMetadataValue( ResponseEntity<MgmtSoftwareModuleMetadata> getMetadataValue(
@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey); @PathVariable("metadataKey") final String metadataKey);
@@ -529,38 +503,35 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Updates a single meta data value of a software module. * Updates a single meta data value of a software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the software module to update the meta data entry
* the ID of the software module to update the meta data entry * @param metadataKey the key of the meta data to update the value
* @param metadataKey * @param metadata body to update
* the key of the meta data to update the value
* @param metadata
* body to update
* @return status OK if the update request is successful and the updated * @return status OK if the update request is successful and the updated
* meta data result * meta data result
*/ */
@Operation(summary = "Update a single meta data value of a Software Module", description = "Update a single meta data value for speficic key. Required Permission: UPDATE_REPOSITORY") @Operation(summary = "Update a single meta data value of a Software Module", description = "Update a single meta data value for speficic key. Required Permission: UPDATE_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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found.", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE, + "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleMetadata> updateMetadata( ResponseEntity<MgmtSoftwareModuleMetadata> updateMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey, final MgmtSoftwareModuleMetadataBodyPut metadata); @PathVariable("metadataKey") final String metadataKey, final MgmtSoftwareModuleMetadataBodyPut metadata);
@@ -568,31 +539,29 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Deletes a single meta data entry from the software module. * Deletes a single meta data entry from the software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the software module to delete the meta data entry
* the ID of the software module to delete the meta data entry * @param metadataKey the key of the meta data to delete
* @param metadataKey
* the key of the meta data to delete
* @return status OK if the delete request is successful * @return status OK if the delete request is successful
*/ */
@Operation(summary = "Delete single meta data entry from the software module", description = "Delete a single meta data. Required Permission: UPDATE_REPOSITORY") @Operation(summary = "Delete single meta data entry from the software module", description = "Delete a single meta data. Required Permission: UPDATE_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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found.", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING @DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata/{metadataKey}") + "/{softwareModuleId}/metadata/{metadataKey}")
@@ -602,43 +571,41 @@ public interface MgmtSoftwareModuleRestApi {
/** /**
* Creates a list of meta data for a specific software module. * Creates a list of meta data for a specific software module.
* *
* @param softwareModuleId * @param softwareModuleId the ID of the distribution set to create meta data for
* the ID of the distribution set to create meta data for * @param metadataRest the list of meta data entries to create
* @param metadataRest
* the list of meta data entries to create
* @return status created if post request is successful with the value of * @return status created if post request is successful with the value of
* the created meta data * the created meta data
*/ */
@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") @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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found", 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.", @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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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.SOFTWAREMODULE_V1_REQUEST_MAPPING @PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE, + "/{softwareModuleId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleMetadata>> createMetadata( ResponseEntity<List<MgmtSoftwareModuleMetadata>> createMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("softwareModuleId") final Long softwareModuleId,
final List<MgmtSoftwareModuleMetadata> metadataRest); final List<MgmtSoftwareModuleMetadata> metadataRest);

View File

@@ -43,19 +43,14 @@ public interface MgmtSoftwareModuleTypeRestApi {
/** /**
* Handles the GET request of retrieving all SoftwareModuleTypes . * Handles the GET request of retrieving all SoftwareModuleTypes .
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of modules for pagination, might not be
* the offset of list of modules for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return a list of all module type for a defined or default page request * @return a list of all module type for a defined or default page request
* with status OK. The response is always paged. In any failure the * with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response. * JsonResponseExceptionHandler is handling the response.
@@ -64,22 +59,22 @@ public interface MgmtSoftwareModuleTypeRestApi {
description = "Handles the GET request of retrieving all software module types. " + description = "Handles the GET request of retrieving all software module types. " +
"Required Permission: READ_REPOSITORY") "Required Permission: 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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -110,33 +105,31 @@ public interface MgmtSoftwareModuleTypeRestApi {
/** /**
* Handles the GET request of retrieving a single software module type . * Handles the GET request of retrieving a single software module type .
* *
* @param softwareModuleTypeId * @param softwareModuleTypeId the ID of the module type to retrieve
* the ID of the module type to retrieve
*
* @return a single softwareModule with status OK. * @return a single softwareModule with status OK.
*/ */
@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. " + description = "Handles the GET request of retrieving a single software module type. " +
"Required Permission: READ_REPOSITORY") "Required Permission: 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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module Type not found.", @ApiResponse(responseCode = "404", description = "Software Module Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING
+ "/{softwareModuleTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) + "/{softwareModuleTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -146,33 +139,31 @@ public interface MgmtSoftwareModuleTypeRestApi {
/** /**
* Handles the DELETE request for a single software module type . * Handles the DELETE request for a single software module type .
* *
* @param softwareModuleTypeId * @param softwareModuleTypeId the ID of the module to retrieve
* the ID of the module to retrieve
* @return status OK if delete as successfully. * @return status OK if delete as successfully.
*
*/ */
@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. " + description = "Handles the DELETE request for a single software module type. " +
"Required Permission: DELETE_REPOSITORY") "Required Permission: DELETE_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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module Type not found.", @ApiResponse(responseCode = "404", description = "Software Module Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}") @DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}")
ResponseEntity<Void> deleteSoftwareModuleType(@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId); ResponseEntity<Void> deleteSoftwareModuleType(@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
@@ -180,45 +171,43 @@ public interface MgmtSoftwareModuleTypeRestApi {
/** /**
* Handles the PUT request of updating a software module type . * Handles the PUT request of updating a software module type .
* *
* @param softwareModuleTypeId * @param softwareModuleTypeId the ID of the software module in the URL
* the ID of the software module in the URL * @param restSoftwareModuleType the module type to be updated.
* @param restSoftwareModuleType
* the module type to be updated.
* @return status OK if update is successful * @return status OK if update is successful
*/ */
@Operation(summary = "Update Software Module Type", @Operation(summary = "Update Software Module Type",
description = "Handles the PUT request for a single software module type. " + description = "Handles the PUT request for a single software module type. " +
"Required Permission: UPDATE_REPOSITORY") "Required Permission: UPDATE_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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module Type not found.", @ApiResponse(responseCode = "404", description = "Software Module Type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING @PutMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING
+ "/{softwareModuleTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE, + "/{softwareModuleTypeId}", 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 }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleType> updateSoftwareModuleType( ResponseEntity<MgmtSoftwareModuleType> updateSoftwareModuleType(
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId, @PathVariable("softwareModuleTypeId") Long softwareModuleTypeId,
MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType); MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType);
@@ -227,8 +216,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
* Handles the POST request of creating new SoftwareModuleTypes. The request * Handles the POST request of creating new SoftwareModuleTypes. The request
* body must always be a list of types. * body must always be a list of types.
* *
* @param softwareModuleTypes * @param softwareModuleTypes the modules to be created.
* the modules to be created.
* @return In case all modules could successful created the ResponseEntity * @return In case all modules could successful created the ResponseEntity
* with status code 201 - Created but without ResponseBody. In any * with status code 201 - Created but without ResponseBody. In any
* failure the JsonResponseExceptionHandler is handling the * failure the JsonResponseExceptionHandler is handling the
@@ -238,34 +226,34 @@ public interface MgmtSoftwareModuleTypeRestApi {
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")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Software Module not found", @ApiResponse(responseCode = "404", description = "Software Module not found",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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, consumes = { @PostMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING, 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 })
ResponseEntity<List<MgmtSoftwareModuleType>> createSoftwareModuleTypes( ResponseEntity<List<MgmtSoftwareModuleType>> createSoftwareModuleTypes(
List<MgmtSoftwareModuleTypeRequestBodyPost> softwareModuleTypes); List<MgmtSoftwareModuleTypeRequestBodyPost> softwareModuleTypes);

View File

@@ -29,8 +29,7 @@ public interface MgmtSystemManagementRestApi {
/** /**
* Deletes the tenant data of a given tenant. USE WITH CARE! * Deletes the tenant data of a given tenant. USE WITH CARE!
* *
* @param tenant * @param tenant to delete
* to delete
* @return HttpStatus.OK * @return HttpStatus.OK
*/ */
@DeleteMapping(value = MgmtRestConstants.SYSTEM_ADMIN_MAPPING + "/tenants/{tenant}") @DeleteMapping(value = MgmtRestConstants.SYSTEM_ADMIN_MAPPING + "/tenants/{tenant}")

View File

@@ -42,32 +42,31 @@ public interface MgmtTargetFilterQueryRestApi {
/** /**
* Handles the GET request of retrieving a single target filter. * Handles the GET request of retrieving a single target filter.
* *
* @param filterId * @param filterId the ID of the target filter to retrieve
* the ID of the target filter to retrieve
* @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 " + @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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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.", @ApiResponse(responseCode = "404", description = "Target filter query not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", produces = { @GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -76,40 +75,36 @@ public interface MgmtTargetFilterQueryRestApi {
/** /**
* Handles the GET request of retrieving all filters. * Handles the GET request of retrieving all filters.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of targets for pagination, might not be
* the offset of list of targets for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
* @return a list of all targets for a defined or default page request with * @return a list of all targets for a defined or default page request with
* status OK. The response is always paged. In any failure the * status OK. The response is always paged. In any failure the
* 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -142,8 +137,7 @@ public interface MgmtTargetFilterQueryRestApi {
* Handles the POST request of creating new target filters. The request body * Handles the POST request of creating new target filters. The request body
* must always be a list of target filters. * must always be a list of target filters.
* *
* @param filter * @param filter the filters to be created.
* the filters to be created.
* @return In case all filters were successfully created the ResponseEntity * @return In case all filters were successfully created the ResponseEntity
* with status code 201 with a list of successfully created entities * with status code 201 with a list of successfully created entities
* is returned. In any failure the JsonResponseExceptionHandler is * is returned. In any failure the JsonResponseExceptionHandler is
@@ -151,32 +145,32 @@ public interface MgmtTargetFilterQueryRestApi {
*/ */
@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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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.TARGET_FILTER_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE, @PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetFilterQuery> createFilter(@RequestBody MgmtTargetFilterQueryRequestBody filter); ResponseEntity<MgmtTargetFilterQuery> createFilter(@RequestBody MgmtTargetFilterQueryRequestBody filter);
/** /**
@@ -184,75 +178,72 @@ public interface MgmtTargetFilterQueryRestApi {
* URL path of the request. A given ID in the request body is ignored. It's * URL path of the request. A given ID in the request body is ignored. It's
* not possible to set fields to {@code null} values. * not possible to set fields to {@code null} values.
* *
* @param filterId * @param filterId the path parameter which contains the ID of the target filter
* the path parameter which contains the ID of the target filter * @param targetFilterRest the request body which contains the fields which should be
* @param targetFilterRest * updated, fields which are not given are ignored for the
* the request body which contains the fields which should be * update.
* updated, fields which are not given are ignored for the
* update.
* @return the updated target filter response which contains all fields * @return the updated target filter response which contains all fields
* including fields which have not been updated * 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = 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 })
ResponseEntity<MgmtTargetFilterQuery> updateFilter(@PathVariable("filterId") Long filterId, ResponseEntity<MgmtTargetFilterQuery> updateFilter(@PathVariable("filterId") Long filterId,
@RequestBody MgmtTargetFilterQueryRequestBody targetFilterRest); @RequestBody MgmtTargetFilterQueryRequestBody targetFilterRest);
/** /**
* Handles the DELETE request of deleting a target filter. * Handles the DELETE request of deleting a target filter.
* *
* @param filterId * @param filterId the ID of the target filter to be deleted
* the ID of the target filter to be deleted
* @return If the given controllerId could exists and could be deleted Http * @return If the given controllerId could exists and could be deleted Http
* OK. In any failure the JsonResponseExceptionHandler is handling * OK. In any failure the JsonResponseExceptionHandler is handling
* 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", produces = { @DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -262,29 +253,28 @@ public interface MgmtTargetFilterQueryRestApi {
* Handles the GET request of retrieving the distribution set for auto * Handles the GET request of retrieving the distribution set for auto
* assignment of an specific target filter. * assignment of an specific target filter.
* *
* @param filterId * @param filterId the ID of the target to retrieve the assigned distribution
* the ID of the target to retrieve the assigned distribution
* @return the assigned distribution set with status OK, if none is assigned * @return the assigned distribution set with status OK, if none is assigned
* than {@code null} content (e.g. "{}") * 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS", produces = { @GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -294,45 +284,43 @@ public interface MgmtTargetFilterQueryRestApi {
* Handles the POST request for changing distribution set for auto * Handles the POST request for changing distribution set for auto
* assignment of a target filter. * assignment of a target filter.
* *
* @param filterId * @param filterId of the target to change
* of the target to change * @param dsIdWithActionType id of the distribution set and the action type for auto
* @param dsIdWithActionType * assignment
* id of the distribution set and the action type for auto
* assignment
* @return http status * @return http status
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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.", @ApiResponse(responseCode = "404", description = "Target filter not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS", consumes = { @PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS", 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 })
ResponseEntity<MgmtTargetFilterQuery> postAssignedDistributionSet(@PathVariable("filterId") Long filterId, ResponseEntity<MgmtTargetFilterQuery> postAssignedDistributionSet(@PathVariable("filterId") Long filterId,
@RequestBody MgmtDistributionSetAutoAssignment dsIdWithActionType); @RequestBody MgmtDistributionSetAutoAssignment dsIdWithActionType);
@@ -340,32 +328,31 @@ public interface MgmtTargetFilterQueryRestApi {
* Handles the DELETE request for removing the distribution set for auto * Handles the DELETE request for removing the distribution set for auto
* assignment of a target filter. * assignment of a target filter.
* *
* @param filterId * @param filterId 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", @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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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.", @ApiResponse(responseCode = "404", description = "Target filter query not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@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);

View File

@@ -42,27 +42,17 @@ import org.springframework.web.bind.annotation.RequestParam;
@Tag(name = "Target Tags", description = "REST API for Target Tag CRUD operations.") @Tag(name = "Target Tags", description = "REST API for Target Tag CRUD operations.")
public interface MgmtTargetTagRestApi { public interface MgmtTargetTagRestApi {
enum OnNotFoundPolicy {
FAIL, // default
ON_WHAT_FOUND_AND_FAIL,
ON_WHAT_FOUND_AND_SUCCESS
}
/** /**
* Handles the GET request of retrieving all target tags. * Handles the GET request of retrieving all target tags.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of target tags for pagination, might not be
* the offset of list of target tags for pagination, might not be * present in the rest request then default value will be applied
* present in the rest request then default value will be applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
* @return a list of all target tags for a defined or default page request * @return a list of all target tags for a defined or default page request
* with status OK. The response is always paged. In any failure the * with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response. * JsonResponseExceptionHandler is handling the response.
@@ -70,16 +60,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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "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 = "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 = "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 " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -110,26 +100,24 @@ public interface MgmtTargetTagRestApi {
/** /**
* Handles the GET request of retrieving a single target tag. * Handles the GET request of retrieving a single target tag.
* *
* @param targetTagId * @param targetTagId the ID of the target tag to retrieve
* the ID of the target tag to retrieve
*
* @return a single target tag with status OK. * @return a single target tag with status OK.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "changed (i.e. read-only) or data volume restriction applies."),
@ApiResponse(responseCode = "404", description = "Target tag not found.", @ApiResponse(responseCode = "404", description = "Target tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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."),
@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."),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}", produces = { @GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -139,8 +127,7 @@ public interface MgmtTargetTagRestApi {
* Handles the POST request of creating new target tag. The request body * Handles the POST request of creating new target tag. The request body
* must always be a list of tags. * must always be a list of tags.
* *
* @param tags * @param tags the target tags to be created.
* the target tags to be created.
* @return In case all modules could successful created the ResponseEntity * @return In case all modules could successful created the ResponseEntity
* with status code 201 - Created. The Response Body are the created * with status code 201 - Created. The Response Body are the created
* target tags but without ResponseBody. * target tags but without ResponseBody.
@@ -148,28 +135,27 @@ 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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "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 = "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 = "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 " + @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."), "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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource."), "supported by the server for this resource."),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE, @PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTag>> createTargetTags(List<MgmtTagRequestBodyPut> tags); ResponseEntity<List<MgmtTag>> createTargetTags(List<MgmtTagRequestBodyPut> tags);
/** /**
*
* Handles the PUT request of updating a single targetr tag. * Handles the PUT request of updating a single targetr tag.
* *
* @param targetTagId the ID of the target tag * @param targetTagId the ID of the target tag
@@ -178,52 +164,50 @@ public interface MgmtTargetTagRestApi {
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "changed (i.e. read-only) or data volume restriction applies."),
@ApiResponse(responseCode = "404", description = "Target tag not found.", @ApiResponse(responseCode = "404", description = "Target tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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."),
@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."),
@ApiResponse(responseCode = "409", description = "E.g. in case an entity is created or modified by another " + @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."), "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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource."), "supported by the server for this resource."),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@PutMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}", consumes = { @PutMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}", 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 })
ResponseEntity<MgmtTag> updateTargetTag(@PathVariable("targetTagId") Long targetTagId, ResponseEntity<MgmtTag> updateTargetTag(@PathVariable("targetTagId") Long targetTagId,
MgmtTagRequestBodyPut restTargetTagRest); MgmtTagRequestBodyPut restTargetTagRest);
/** /**
* Handles the DELETE request for a single target tag. * Handles the DELETE request for a single target tag.
* *
* @param targetTagId * @param targetTagId the ID of the target tag
* the ID of the target tag
* @return status OK if delete as successfully. * @return status OK if delete as successfully.
*
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "changed (i.e. read-only) or data volume restriction applies."),
@ApiResponse(responseCode = "404", description = "Target tag not found.", @ApiResponse(responseCode = "404", description = "Target tag not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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."),
@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."),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}") @DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}")
ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") Long targetTagId); ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") Long targetTagId);
@@ -232,42 +216,36 @@ public interface MgmtTargetTagRestApi {
* Handles the GET request of retrieving all assigned targets by the given * Handles the GET request of retrieving all assigned targets by the given
* tag id. * tag id.
* *
* @param targetTagId * @param targetTagId the ID of the target tag to retrieve
* the ID of the target tag to retrieve * @param pagingOffsetParam the offset of list of target tags for pagination, might not be
* @param pagingOffsetParam * present in the rest request then default value will be applied
* the offset of list of target tags for pagination, might not be * @param pagingLimitParam the limit of the paged request, might not be present in the
* present in the rest request then default value will be applied * rest request then default value will be applied
* @param pagingLimitParam * @param sortParam the sorting parameter in the request URL, syntax
* the limit of the paged request, might not be present in the * {@code field:direction, field:direction}
* rest request then default value will be applied * @param rsqlParam the search parameter in the request URL, syntax
* @param sortParam * {@code q=name==abc}
* the sorting parameter in the request URL, syntax
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return the list of assigned targets. * @return the list of assigned targets.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "changed (i.e. read-only) or data volume restriction applies."),
@ApiResponse(responseCode = "404", description = "Target tag not found", @ApiResponse(responseCode = "404", description = "Target tag not found",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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."),
@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."),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING @GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(@PathVariable("targetTagId") Long targetTagId, ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(@PathVariable("targetTagId") Long targetTagId,
@RequestParam( @RequestParam(
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
@@ -297,7 +275,6 @@ public interface MgmtTargetTagRestApi {
* *
* @param targetTagId the ID of the target tag to retrieve * @param targetTagId the ID of the target tag to retrieve
* @param controllerId stream of controller ids to be assigned * @param controllerId stream of controller ids to be assigned
*
* @return the list of assigned targets. * @return the list of assigned targets.
*/ */
@Operation(summary = "Assign target(s) to given tagId", @Operation(summary = "Assign target(s) to given tagId",
@@ -319,7 +296,7 @@ public interface MgmtTargetTagRestApi {
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + @PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING +
MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/{controllerId}") 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);
@@ -329,7 +306,6 @@ public interface MgmtTargetTagRestApi {
* *
* @param targetTagId the ID of the target tag to retrieve * @param targetTagId the ID of the target tag to retrieve
* @param controllerIds stream of controller ids to be assigned * @param controllerIds stream of controller ids to be assigned
*
* @return the list of assigned targets. * @return the list of assigned targets.
*/ */
@Operation(summary = "Assign target(s) to given tagId", @Operation(summary = "Assign target(s) to given tagId",
@@ -354,7 +330,7 @@ public interface MgmtTargetTagRestApi {
}) })
@PutMapping( @PutMapping(
value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, 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> assignTargets( ResponseEntity<Void> assignTargets(
@PathVariable("targetTagId") Long targetTagId, @PathVariable("targetTagId") Long targetTagId,
@RequestParam(value = "onNotFoundPolicy", required = false, defaultValue = "FAIL") OnNotFoundPolicy onNotFoundPolicy, @RequestParam(value = "onNotFoundPolicy", required = false, defaultValue = "FAIL") OnNotFoundPolicy onNotFoundPolicy,
@@ -425,12 +401,10 @@ public interface MgmtTargetTagRestApi {
* Handles the POST request to toggle the assignment of targets by the given * Handles the POST request to toggle the assignment of targets by the given
* tag id. * tag id.
* *
* @deprecated since 0.6.0 - not very usable with very unclear logic * @param targetTagId the ID of the target tag to retrieve
* @param targetTagId * @param assignedTargetRequestBodies list of controller ids to be toggled
* the ID of the target tag to retrieve
* @param assignedTargetRequestBodies
* list of controller ids to be toggled
* @return the list of assigned targets and unassigned targets. * @return the list of assigned targets and unassigned targets.
* @deprecated since 0.6.0 - not very usable with very unclear logic
*/ */
@Operation(summary = "[DEPRECATED] Toggles target tag assignment", description = "Handles the POST request of toggle target " + @Operation(summary = "[DEPRECATED] Toggles target tag assignment", description = "Handles the POST request of toggle target " +
"assignment. The request body must always be a list of controller ids.") "assignment. The request body must always be a list of controller ids.")
@@ -460,34 +434,40 @@ public interface MgmtTargetTagRestApi {
/** /**
* Handles the POST request to assign targets to the given tag id. * Handles the POST request to assign targets to the given tag id.
* *
* @deprecated since 0.6.0 in favour of {@link #assignTargets}
* @param targetTagId the ID of the target tag to retrieve * @param targetTagId the ID of the target tag to retrieve
* @param assignedTargetRequestBodies list of controller ids to be assigned * @param assignedTargetRequestBodies list of controller ids to be assigned
* @return the list of assigned targets. * @return the list of assigned targets.
* @deprecated since 0.6.0 in favour of {@link #assignTargets}
*/ */
@Operation(summary = "[DEPRECATED] Assign target(s) to given tagId and return targets", @Operation(summary = "[DEPRECATED] Assign target(s) to given tagId and return targets",
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 = { @ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Successfully assigned"), @ApiResponse(responseCode = "200", description = "Successfully assigned"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication."), @ApiResponse(responseCode = "401", description = "The request requires user authentication."),
@ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " + @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be " +
"changed (i.e. read-only) or data volume restriction applies."), "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 = "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 = "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 " + @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."), "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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource."), "supported by the server for this resource."),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.") "and the client has to wait another second.")
}) })
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING @PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@Deprecated(forRemoval = true) @Deprecated(forRemoval = true)
ResponseEntity<List<MgmtTarget>> assignTargetsByRequestBody(@PathVariable("targetTagId") Long targetTagId, ResponseEntity<List<MgmtTarget>> assignTargetsByRequestBody(@PathVariable("targetTagId") Long targetTagId,
List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies); List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
enum OnNotFoundPolicy {
FAIL, // default
ON_WHAT_FOUND_AND_FAIL,
ON_WHAT_FOUND_AND_SUCCESS
}
} }

View File

@@ -44,42 +44,37 @@ public interface MgmtTargetTypeRestApi {
/** /**
* Handles the GET request of retrieving all TargetTypes. * Handles the GET request of retrieving all TargetTypes.
* *
* @param pagingOffsetParam * @param pagingOffsetParam the offset of list of target types for pagination, might not
* the offset of list of target types for pagination, might not * be present in the rest request then default value will be
* be present in the rest request then default value will be * applied
* applied * @param pagingLimitParam the limit of the paged request, might not be present in the
* @param pagingLimitParam * rest request then default value will be applied
* the limit of the paged request, might not be present in the * @param sortParam the sorting parameter in the request URL, syntax
* rest request then default value will be applied * {@code field:direction, field:direction}
* @param sortParam * @param rsqlParam the search parameter in the request URL, syntax
* the sorting parameter in the request URL, syntax * {@code q=name==abc}
* {@code field:direction, field:direction}
* @param rsqlParam
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return a list of all TargetTypes for a defined or default page request * @return a list of all TargetTypes for a defined or default page request
* with status OK. The response is always paged. In any failure the * with status OK. The response is always paged. In any failure the
* 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, @GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
@@ -110,32 +105,30 @@ public interface MgmtTargetTypeRestApi {
/** /**
* Handles the GET request of retrieving a single TargetType. * Handles the GET request of retrieving a single TargetType.
* *
* @param targetTypeId * @param targetTypeId the ID of the target type to retrieve
* the ID of the target type to retrieve
*
* @return a single target type with status OK. * @return a single target type with status OK.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 type not found.", @ApiResponse(responseCode = "404", description = "Target type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}", produces = { @GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -144,32 +137,30 @@ public interface MgmtTargetTypeRestApi {
/** /**
* Handles the DELETE request for a single Target Type. * Handles the DELETE request for a single Target Type.
* *
* @param targetTypeId * @param targetTypeId the ID of the target type to retrieve
* the ID of the target type to retrieve
* @return status OK if delete is successful. * @return status OK if delete is successful.
*
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 type not found.", @ApiResponse(responseCode = "404", description = "Target type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@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);
@@ -177,43 +168,41 @@ public interface MgmtTargetTypeRestApi {
/** /**
* Handles the PUT request of updating a Target Type. * Handles the PUT request of updating a Target Type.
* *
* @param targetTypeId * @param targetTypeId the ID of the target type in the URL
* the ID of the target type in the URL * @param restTargetType the target type to be updated.
* @param restTargetType
* the target type to be updated.
* @return status OK if update is successful * @return status OK if update is successful
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 type not found.", @ApiResponse(responseCode = "404", description = "Target type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}", consumes = { @PutMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}", 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 })
ResponseEntity<MgmtTargetType> updateTargetType(@PathVariable("targetTypeId") Long targetTypeId, ResponseEntity<MgmtTargetType> updateTargetType(@PathVariable("targetTypeId") Long targetTypeId,
MgmtTargetTypeRequestBodyPut restTargetType); MgmtTargetTypeRequestBodyPut restTargetType);
@@ -221,8 +210,7 @@ public interface MgmtTargetTypeRestApi {
* Handles the POST request of creating new Target Types. The request body * Handles the POST request of creating new Target Types. The request body
* must always be a list of types. * must always be a list of types.
* *
* @param targetTypes * @param targetTypes the target types to be created.
* the target types to be created.
* @return In case all target types could be successfully created the * @return In case all target types could be successfully created the
* ResponseEntity with status code 201 - Created but without * ResponseEntity with status code 201 - Created but without
* ResponseBody. In any failure the JsonResponseExceptionHandler is * ResponseBody. In any failure the JsonResponseExceptionHandler is
@@ -231,70 +219,69 @@ 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")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Successfully created"), @ApiResponse(responseCode = "201", description = "Successfully created"),
@ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 type not found.", @ApiResponse(responseCode = "404", description = "Target type not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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, consumes = { MediaTypes.HAL_JSON_VALUE, @PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTargetType>> createTargetTypes(List<MgmtTargetTypeRequestBodyPost> targetTypes); ResponseEntity<List<MgmtTargetType>> createTargetTypes(List<MgmtTargetTypeRequestBodyPost> targetTypes);
/** /**
* Handles the GET request of retrieving the list of compatible distribution * Handles the GET request of retrieving the list of compatible distribution
* set types in that target type. * set types in that target type.
* *
* @param targetTypeId * @param targetTypeId of the TargetType.
* of the TargetType.
* @return Unpaged list of distribution set types and OK in case of success. * @return Unpaged list of distribution set types and OK in case of success.
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution set type was not found.", @ApiResponse(responseCode = "404", description = "Distribution set type was not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" @GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/"
+ MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, produces = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtDistributionSetType>> getCompatibleDistributionSets( ResponseEntity<List<MgmtDistributionSetType>> getCompatibleDistributionSets(
@PathVariable("targetTypeId") Long targetTypeId); @PathVariable("targetTypeId") Long targetTypeId);
@@ -302,35 +289,32 @@ public interface MgmtTargetTypeRestApi {
* Handles DELETE request for removing the compatibility of a distribution * Handles DELETE request for removing the compatibility of a distribution
* set type from the target type. * set type from the target type.
* *
* @param targetTypeId * @param targetTypeId of the TargetType.
* of the TargetType. * @param distributionSetTypeId of the DistributionSetType.
* @param distributionSetTypeId
* of the DistributionSetType.
*
* @return OK if the request was successful * @return OK if the request was successful
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution set type was not found.", @ApiResponse(responseCode = "404", description = "Distribution set type was not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/" @DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/"
+ MgmtRestConstants.TARGETTYPE_V1_DS_TYPES + "/{distributionSetTypeId}") + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES + "/{distributionSetTypeId}")
@@ -341,45 +325,42 @@ public interface MgmtTargetTypeRestApi {
* Handles the POST request for adding the compatibility of a distribution * Handles the POST request for adding the compatibility of a distribution
* set type to a target type. * set type to a target type.
* *
* @param targetTypeId * @param targetTypeId of the TargetType.
* of the TargetType. * @param distributionSetTypeIds of the DistributionSetTypes as a List.
* @param distributionSetTypeIds
* of the DistributionSetTypes as a List.
*
* @return OK if the request was successful * @return OK if the request was successful
*/ */
@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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Distribution set type was not found.", @ApiResponse(responseCode = "404", description = "Distribution set type was not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 + "/{targetTypeId}/" @PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/"
+ MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE, + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }) MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> addCompatibleDistributionSets(@PathVariable("targetTypeId") final Long targetTypeId, ResponseEntity<Void> addCompatibleDistributionSets(@PathVariable("targetTypeId") final Long targetTypeId,
final List<MgmtDistributionSetTypeAssignment> distributionSetTypeIds); final List<MgmtDistributionSetTypeAssignment> distributionSetTypeIds);
} }

View File

@@ -47,22 +47,22 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs", produces = { @GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -72,8 +72,7 @@ public interface MgmtTenantManagementRestApi {
* Handles the DELETE request of deleting a tenant specific configuration * Handles the DELETE request of deleting a tenant specific configuration
* value. * value.
* *
* @param keyName * @param keyName the Name of the configuration key
* the Name of the configuration key
* @return if the given configuration value exists and could be deleted HTTP * @return if the given configuration value exists and could be deleted HTTP
* OK. In any failure the JsonResponseExceptionHandler is handling * OK. In any failure the JsonResponseExceptionHandler is handling
* the response. * the response.
@@ -82,22 +81,22 @@ public interface MgmtTenantManagementRestApi {
"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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@DeleteMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = { @DeleteMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -107,8 +106,7 @@ public interface MgmtTenantManagementRestApi {
* Handles the GET request of receiving a tenant specific configuration * Handles the GET request of receiving a tenant specific configuration
* value. * value.
* *
* @param keyName * @param keyName the name of the configuration key
* the name of the configuration key
* @return if the given configuration value exists and could be get HTTP OK. * @return if the given configuration value exists and could be get HTTP OK.
* In any failure the JsonResponseExceptionHandler is handling the * In any failure the JsonResponseExceptionHandler is handling the
* response. * response.
@@ -117,24 +115,24 @@ public interface MgmtTenantManagementRestApi {
"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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Configuration key not found.", @ApiResponse(responseCode = "404", description = "Configuration key not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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)))
}) })
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = { @GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@@ -145,10 +143,8 @@ public interface MgmtTenantManagementRestApi {
* Handles the PUT request for updating a tenant specific configuration * Handles the PUT request for updating a tenant specific configuration
* value. * value.
* *
* @param keyName * @param keyName the name of the configuration key
* the name of the configuration key * @param configurationValueRest the new value for the configuration
* @param configurationValueRest
* the new value for the configuration
* @return if the given configuration value exists and could be get HTTP OK. * @return if the given configuration value exists and could be get HTTP OK.
* In any failure the JsonResponseExceptionHandler is handling the * In any failure the JsonResponseExceptionHandler is handling the
* response. * response.
@@ -157,43 +153,41 @@ public interface MgmtTenantManagementRestApi {
"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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "Configuration key not found.", @ApiResponse(responseCode = "404", description = "Configuration key not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", consumes = { @PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", 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 })
ResponseEntity<MgmtSystemTenantConfigurationValue> updateTenantConfigurationValue( ResponseEntity<MgmtSystemTenantConfigurationValue> updateTenantConfigurationValue(
@PathVariable("keyName") String keyName, MgmtSystemTenantConfigurationValueRequest configurationValueRest); @PathVariable("keyName") String keyName, MgmtSystemTenantConfigurationValueRequest configurationValueRest);
/** /**
* Handles the PUT request for updating a batch of tenant specific configurations * Handles the PUT request for updating a batch of tenant specific configurations
* *
* @param configurationValueMap * @param configurationValueMap a Map of name - value pairs for the configurations
* a Map of name - value pairs for the configurations
*
* @return if the given configurations values exists and could be get HTTP OK. * @return if the given configurations values exists and could be get HTTP OK.
* In any failure the JsonResponseExceptionHandler is handling the * In any failure the JsonResponseExceptionHandler is handling the
* response. * response.
@@ -201,28 +195,28 @@ 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 = { @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",
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))),
@ApiResponse(responseCode = "401", description = "The request requires user authentication.", @ApiResponse(responseCode = "401", description = "The request requires user authentication.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", @ApiResponse(responseCode = "403",
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 = "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.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), 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 " + @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.", "user in another request at the same time. You may retry your modification request.",
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 " + @ApiResponse(responseCode = "415", description = "The request was attempt with a media-type which is not " +
"supported by the server for this resource.", "supported by the server for this resource.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " + @ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.", "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 = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs", consumes = { @PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs", 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,

View File

@@ -9,6 +9,8 @@
*/ */
package org.eclipse.hawkbit.mgmt.json.model; package org.eclipse.hawkbit.mgmt.json.model;
import static org.assertj.core.api.Assertions.assertThat;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.qameta.allure.Feature; import io.qameta.allure.Feature;
@@ -16,8 +18,6 @@ import io.qameta.allure.Story;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
@Feature("Unit Tests - Management API") @Feature("Unit Tests - Management API")
@Story("Serialization") @Story("Serialization")
public class AuditFieldSerializationTest { public class AuditFieldSerializationTest {

View File

@@ -45,12 +45,6 @@ public class PagedListTest {
assertListSize(knownTotal, knownContentList); assertListSize(knownTotal, knownContentList);
} }
private void assertListSize(final long knownTotal, final List<String> knownContentList) {
final PagedList<String> pagedList = new PagedList<>(knownContentList, knownTotal);
assertThat(pagedList.getTotal()).as("total size is wrong").isEqualTo(knownTotal);
assertThat(pagedList.getSize()).as("list size is wrong").isEqualTo(knownContentList.size());
}
@Test @Test
@Description("Create list with payload and verify size values.") @Description("Create list with payload and verify size values.")
public void createListWithSmallerTotalThanContentSizeIsOk() { public void createListWithSmallerTotalThanContentSizeIsOk() {
@@ -61,4 +55,10 @@ public class PagedListTest {
assertListSize(knownTotal, knownContentList); assertListSize(knownTotal, knownContentList);
} }
private void assertListSize(final long knownTotal, final List<String> knownContentList) {
final PagedList<String> pagedList = new PagedList<>(knownContentList, knownTotal);
assertThat(pagedList.getTotal()).as("total size is wrong").isEqualTo(knownTotal);
assertThat(pagedList.getSize()).as("list size is wrong").isEqualTo(knownContentList.size());
}
} }

View File

@@ -16,10 +16,9 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import io.qameta.allure.Story;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.qameta.allure.Story;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Description; import org.springframework.context.annotation.Description;