summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionCatalogServlet.java85
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionServlet.java123
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java133
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java29
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/CrudExternalServlet.java33
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServlet.java6
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ServiceActivationServlet.java13
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java70
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArchiveEndpoint.java99
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java185
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java38
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpoint.java24
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java6
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java18
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/CapabilityServlet.java70
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java209
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentPropertyServlet.java126
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java71
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigMgrServlet.java6
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigServlet.java20
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java32
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java28
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java180
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpoint.java21
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java20
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupEndpoint.java56
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java82
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupTypesEndpoint.java19
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java103
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InterfaceOperationServlet.java59
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java16
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyServlet.java80
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpoint.java22
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementServlet.java78
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java23
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java79
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java16
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceFilterServlet.java30
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceForwardingPathServlet.java53
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java114
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java59
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadEndpoint.java16
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java77
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java77
44 files changed, 1395 insertions, 1309 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionCatalogServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionCatalogServlet.java
index 4c5b4f67d8..f0d329ec20 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionCatalogServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionCatalogServlet.java
@@ -23,15 +23,16 @@
package org.openecomp.sdc.be.distribution.servlet;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -73,7 +74,8 @@ import java.util.Map;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Distribution Catalog Servlet",description = "This Servlet serves external users to download artifacts."))
+@Tags({@Tag(name = "SDC Distribution APIs")})
+@Servers({@Server(url = "/sdc")})
@Singleton
public class DistributionCatalogServlet extends BeGenericServlet {
@@ -112,19 +114,23 @@ public class DistributionCatalogServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Operation(description = "Download service artifact", method = "GET", summary = "Returns downloaded artifact",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "The artifact is found and streamed.",
+ responses = {@ApiResponse(
content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
- @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
- @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "404", description = "Specified Service is not found - SVC4503"),
- @ApiResponse(responseCode = "404", description = "Specified Service Version is not found - SVC4504"),
- @ApiResponse(responseCode = "404", description = "Specified artifact is not found - SVC4505"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
+ @ApiResponse(responseCode = "200", description = "The artifact is found and streamed.",
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "400",
+ description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
+ @ApiResponse(responseCode = "404", description = "Specified Service is not found - SVC4503"),
+ @ApiResponse(responseCode = "404",
+ description = "Specified Service Version is not found - SVC4504"),
+ @ApiResponse(responseCode = "404", description = "Specified artifact is not found - SVC4505"),
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response downloadServiceArtifact(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
@@ -187,20 +193,26 @@ public class DistributionCatalogServlet extends BeGenericServlet {
@Path("/services/{serviceName}/{serviceVersion}/resources/{resourceName}/{resourceVersion}/artifacts/{artifactName}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Download resource artifact", method = "GET", summary = "Returns downloaded artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "The artifact is found and streamed.",
+ @Operation(description = "Download resource artifact", method = "GET", summary = "Returns downloaded artifact",
+ responses = {@ApiResponse(
content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
- @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
- @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "404", description = "Specified Service is not found - SVC4503"),
- @ApiResponse(responseCode = "404", description = "Specified Resource Instance is not found - SVC4526"),
- @ApiResponse(responseCode = "404", description = "Specified Service Version is not found - SVC4504"),
- @ApiResponse(responseCode = "404", description = "Specified artifact is not found - SVC4505"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
+ @ApiResponse(responseCode = "200", description = "The artifact is found and streamed.",
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "400",
+ description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
+ @ApiResponse(responseCode = "404", description = "Specified Service is not found - SVC4503"),
+ @ApiResponse(responseCode = "404",
+ description = "Specified Resource Instance is not found - SVC4526"),
+ @ApiResponse(responseCode = "404",
+ description = "Specified Service Version is not found - SVC4504"),
+ @ApiResponse(responseCode = "404", description = "Specified artifact is not found - SVC4505"),
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response downloadResourceArtifact(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
@@ -256,20 +268,23 @@ public class DistributionCatalogServlet extends BeGenericServlet {
@Path("/services/{serviceName}/{serviceVersion}/resourceInstances/{resourceInstanceName}/artifacts/{artifactName}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Download resource instance artifact", method = "GET", summary = "Returns downloaded artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
+ @Operation(description = "Download resource instance artifact", method = "GET",
+ summary = "Returns downloaded artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "200", description = "The artifact is found and streamed.",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
@ApiResponse(responseCode = "404", description = "Specified Service is not found - SVC4503"),
@ApiResponse(responseCode = "404", description = "Specified Resource Instance is not found - SVC4526"),
@ApiResponse(responseCode = "404", description = "Specified Service Version is not found - SVC4504"),
@ApiResponse(responseCode = "404", description = "Specified artifact is not found - SVC4505"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response downloadResourceInstanceArtifactByName(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionServlet.java
index caa5db195b..c6856eb42d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/distribution/servlet/DistributionServlet.java
@@ -22,17 +22,17 @@ package org.openecomp.sdc.be.distribution.servlet;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
@@ -77,8 +77,8 @@ import javax.ws.rs.core.Response;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1")
-@OpenAPIDefinition(info = @Info(title = "Distribution Servlet",description = "This Servlet serves external users for distribution purposes."))
-
+@Tags({@Tag(name = "SDC Distribution APIs")})
+@Servers({@Server(url = "/sdc")})
@Controller
public class DistributionServlet extends BeGenericServlet {
@@ -107,19 +107,24 @@ public class DistributionServlet extends BeGenericServlet {
@Path("/distributionUebCluster")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "UEB Server List", method = "GET", summary = "return the available UEB Server List")
+ @Operation(description = "UEB Server List", method = "GET", summary = "return the available UEB Server List",
+ responses = {@ApiResponse(responseCode = "200",
+ description = "ECOMP component is authenticated and list of Cambria API server’s FQDNs is returned",
+ content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ServerListResponse.class)))),
+ @ApiResponse(responseCode = "400",
+ description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its credentials for Basic Authentication - POL5002"),
+ @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed: Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
//TODO Tal G fix response headers
/*responseHeaders = {
@ResponseHeader(name = Constants.CONTENT_TYPE_HEADER, description = "Determines the format of the response body", response = String.class),
@ResponseHeader(name = "Content-Length", description = "Length of the response body", response = String.class)})*/
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "ECOMP component is authenticated and list of Cambria API server’s FQDNs is returned",
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = ServerListResponse.class)))),
- @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its credentials for Basic Authentication - POL5002"),
- @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed: Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response getUebServerList(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
@@ -179,20 +184,28 @@ public class DistributionServlet extends BeGenericServlet {
@Path("/registerForDistribution")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(parameters = @Parameter(name = "requestJson", required = true ), description = "Subscription status", method = "POST", summary = "Subscribes for distribution notifications")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "ECOMP component is successfully registered for distribution",content = @Content(array = @ArraySchema(schema = @Schema(implementation = TopicRegistrationResponse.class)))),
- @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "400", description = "Missing Body - POL4500"),
- @ApiResponse(responseCode = "400", description = "Invalid Body : missing mandatory parameter 'apiPublicKey' - POL4501"),
- @ApiResponse(responseCode = "400", description = "Invalid Body : missing mandatory parameter 'distrEnvName' - POL4502"),
- @ApiResponse(responseCode = "400", description = "Invalid Body : Specified 'distrEnvName' doesn’t exist - POL4137"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
- @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed : Invalid HTTP method type used to register for distribution ( PUT,DELETE,GET will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component should continue the attempts to register for distribution - POL5000")})
-
- @ApiImplicitParams({@ApiImplicitParam(name = "requestJson", required = true, dataType = "org.openecomp.sdc.be.distribution.api.client.RegistrationRequest", paramType = "body", value = "json describe the artifact")})
+ @Operation(parameters = {@Parameter(name = "requestJson", required = true,
+ schema = @Schema(implementation = org.openecomp.sdc.be.distribution.api.client.RegistrationRequest.class))},
+ description = "Subscription status", method = "POST", summary = "Subscribes for distribution notifications",
+ responses = {@ApiResponse(responseCode = "200",
+ description = "ECOMP component is successfully registered for distribution", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = TopicRegistrationResponse.class)))),
+ @ApiResponse(responseCode = "400",
+ description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
+ @ApiResponse(responseCode = "400", description = "Missing Body - POL4500"),
+ @ApiResponse(responseCode = "400",
+ description = "Invalid Body : missing mandatory parameter 'apiPublicKey' - POL4501"),
+ @ApiResponse(responseCode = "400",
+ description = "Invalid Body : missing mandatory parameter 'distrEnvName' - POL4502"),
+ @ApiResponse(responseCode = "400",
+ description = "Invalid Body : Specified 'distrEnvName' doesn’t exist - POL4137"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed : Invalid HTTP method type used to register for distribution ( PUT,DELETE,GET will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component should continue the attempts to register for distribution - POL5000")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response registerForDistribution(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
@@ -234,14 +247,18 @@ public class DistributionServlet extends BeGenericServlet {
@Path("/artifactTypes")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Artifact types list", method = "GET", summary = "Fetches available artifact types list")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact types list fetched successfully", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
- @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
- @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed : Invalid HTTP method type used to register for distribution ( POST,PUT,DELETE will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component should continue the attempts to register for distribution - POL5000")})
+ @Operation(description = "Artifact types list", method = "GET", summary = "Fetches available artifact types list",
+ responses = {@ApiResponse(responseCode = "200", description = "Artifact types list fetched successfully",
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "400",
+ description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed : Invalid HTTP method type used to register for distribution ( POST,PUT,DELETE will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component should continue the attempts to register for distribution - POL5000")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response getValidArtifactTypes(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
@@ -280,22 +297,28 @@ public class DistributionServlet extends BeGenericServlet {
@Path("/unRegisterForDistribution")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(parameters = @Parameter(name = "requestJson", required = true ),description = "Subscription status", method = "POST", summary = "Removes from subscription for distribution notifications")
- //TODO Edit the responses
- @ApiResponses(value = {
+ @Operation(parameters = @Parameter(name = "requestJson", required = true), description = "Subscription status",
+ method = "POST", summary = "Removes from subscription for distribution notifications", responses = {
@ApiResponse(responseCode = "204", description = "ECOMP component is successfully unregistered",
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = TopicUnregistrationResponse.class)))),
+ content = @Content(array = @ArraySchema(
+ schema = @Schema(implementation = TopicUnregistrationResponse.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "400", description = "Missing Body - POL4500"),
- @ApiResponse(responseCode = "400", description = "Invalid Body : missing mandatory parameter 'apiPublicKey' - POL4501"),
- @ApiResponse(responseCode = "400", description = "Invalid Body : missing mandatory parameter 'distrEnvName' - SVC4506"),
- @ApiResponse(responseCode = "400", description = "Invalid Body : Specified 'distrEnvName' doesn’t exist - POL4137"),
- @ApiResponse(responseCode = "401", description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "400",
+ description = "Invalid Body : missing mandatory parameter 'apiPublicKey' - POL4501"),
+ @ApiResponse(responseCode = "400",
+ description = "Invalid Body : missing mandatory parameter 'distrEnvName' - SVC4506"),
+ @ApiResponse(responseCode = "400",
+ description = "Invalid Body : Specified 'distrEnvName' doesn’t exist - POL4137"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed : Invalid HTTP method type used to register for distribution ( PUT,DELETE,GET will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500", description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component should continue the attempts to register for distribution - POL5000")})
- //@ApiImplicitParams({@ApiImplicitParam(name = "requestJson", required = true, dataType = "org.openecomp.sdc.be.distribution.api.client.RegistrationRequest", paramType = "body", value = "json describe the artifact")})
- @ApiImplicitParams({@ApiImplicitParam(name = "requestJson", required = true, dataType = "org.openecomp.sdc.be.distribution.api.client.RegistrationRequest", paramType = "body", value = "json describe the artifact")})
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed : Invalid HTTP method type used to register for distribution ( PUT,DELETE,GET will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The registration failed due to internal SDC problem or Cambria Service failure ECOMP Component should continue the attempts to register for distribution - POL5000")})
+ //TODO Edit the responses
+ @Parameters({@Parameter(name = "requestJson", required = true, schema = @Schema(implementation = org.openecomp.sdc.be.distribution.api.client.RegistrationRequest.class) , description = "json describe the artifact")})
@PermissionAllowed({AafPermission.PermNames.READ_VALUE})
public Response unRegisterForDistribution(
@Parameter(description = "X-ECOMP-RequestID header", required = false)@HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java
index 1dc8907254..a2395c8541 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java
@@ -22,17 +22,16 @@ package org.openecomp.sdc.be.externalapi.servlet;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
@@ -86,9 +85,8 @@ import java.util.Map;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-
-@OpenAPIDefinition(info = @Info(title = "Artifact External Servlet",
- description = "Servlet serves external users operations on artifacts."))
+@Tags({@Tag(name = "SDC External APIs")})
+@Servers({@Server(url = "/sdc")})
@Controller
public class ArtifactExternalServlet extends AbstractValidationsServlet {
@@ -116,12 +114,12 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@POST
@Path("/{assetType}/{uuid}/interfaces/{interfaceUUID}/operations/{operationUUID}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(parameters = @Parameter(required = true ),description = "uploads of artifact to VF operation workflow", method = "POST",
- summary = "uploads of artifact to VF operation workflow")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact uploaded",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ @Operation(parameters = {@Parameter(required = true,
+ schema = @Schema(implementation = org.openecomp.sdc.be.model.ArtifactDefinition.class))},
+ description = "uploads of artifact to VF operation workflow", method = "POST",
+ summary = "uploads of artifact to VF operation workflow", responses = {
+ @ApiResponse(responseCode = "200", description = "Artifact uploaded", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -142,7 +140,6 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
@ApiResponse(responseCode = "400",
description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
public Response uploadInterfaceOperationArtifact(
@Parameter(description = "Determines the format of the body of the request",
required = true) @HeaderParam(value = HttpHeaders.CONTENT_TYPE) String contentType,
@@ -223,12 +220,12 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@POST
@Path("/{assetType}/{uuid}/artifacts")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "uploads of artifact to a resource or service", method = "POST",
- summary = "uploads of artifact to a resource or service")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact uploaded",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ @Operation(parameters = {@Parameter(required = true,
+ schema = @Schema(implementation = org.openecomp.sdc.be.model.ArtifactDefinition.class))},
+ description = "uploads of artifact to a resource or service", method = "POST",
+ summary = "uploads of artifact to a resource or service", responses = {
+ @ApiResponse(responseCode = "200", description = "Artifact uploaded", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -249,10 +246,6 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
@ApiResponse(responseCode = "400",
description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
- // @ApiImplicitParams({@ApiImplicitParam(required = true, dataType =
- // "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the
- // artifact")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
@PermissionAllowed({AafPermission.PermNames.WRITE_VALUE})
public Response uploadArtifact(
@Parameter(description = "Determines the format of the body of the request",
@@ -331,12 +324,12 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@POST
@Path("/{assetType}/{uuid}/resourceInstances/{resourceInstanceName}/artifacts")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "uploads an artifact to a resource instance", method = "POST",
- summary = "uploads an artifact to a resource instance")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact uploaded",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ @Operation(parameters = {@Parameter(required = true,
+ schema = @Schema(implementation = org.openecomp.sdc.be.model.ArtifactDefinition.class),
+ description = "json describe the artifact")}, description = "uploads an artifact to a resource instance",
+ method = "POST", summary = "uploads an artifact to a resource instance", responses = {
+ @ApiResponse(responseCode = "200", description = "Artifact uploaded", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -357,7 +350,6 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
@ApiResponse(responseCode = "400",
description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
@PermissionAllowed(AafPermission.PermNames.WRITE_VALUE)
public Response uploadArtifactToInstance(
@Parameter(description = "Determines the format of the body of the request",
@@ -437,12 +429,12 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@POST
@Path("/{assetType}/{uuid}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "updates an artifact on a resource or service", method = "POST",
- summary = "uploads of artifact to a resource or service")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact updated",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ @Operation(parameters = {@Parameter(required = true,
+ schema = @Schema(implementation = org.openecomp.sdc.be.model.ArtifactDefinition.class),
+ description = "json describe the artifact")}, description = "updates an artifact on a resource or service",
+ method = "POST", summary = "uploads of artifact to a resource or service", responses = {
+ @ApiResponse(responseCode = "200", description = "Artifact updated", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -461,7 +453,6 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
@ApiResponse(responseCode = "409",
description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
@PermissionAllowed(AafPermission.PermNames.WRITE_VALUE)
public Response updateArtifact(
@Parameter(description = "Determines the format of the body of the request",
@@ -545,12 +536,12 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@POST
@Path("/{assetType}/{uuid}/resourceInstances/{resourceInstanceName}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "updates an artifact on a resource instance", method = "POST",
- summary = "uploads of artifact to a resource or service")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact updated",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ @Operation(parameters = {@Parameter(required = true,
+ schema = @Schema(implementation = org.openecomp.sdc.be.model.ArtifactDefinition.class),
+ description = "json describe the artifact")}, description = "updates an artifact on a resource instance",
+ method = "POST", summary = "uploads of artifact to a resource or service", responses = {
+ @ApiResponse(responseCode = "200", description = "Artifact updated", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -569,7 +560,6 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
@ApiResponse(responseCode = "409",
description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
@PermissionAllowed(AafPermission.PermNames.WRITE_VALUE)
public Response updateArtifactOnResourceInstance(
@Parameter(description = "Determines the format of the body of the request",
@@ -657,12 +647,10 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@Path("/{assetType}/{uuid}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "deletes an artifact of a resource or service", method = "DELETE",
- summary = "deletes an artifact of a resource or service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact deleted",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ summary = "deletes an artifact of a resource or service", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Artifact deleted", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -762,12 +750,10 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@Path("{assetType}/{uuid}/resourceInstances/{resourceInstanceName}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "deletes an artifact of a resource insatnce", method = "DELETE",
- summary = "deletes an artifact of a resource insatnce", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact deleted",
- content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ summary = "deletes an artifact of a resource insatnce", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Artifact deleted", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -866,20 +852,20 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@GET
@Path("/{assetType}/{uuid}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Download component artifact", method = "GET", summary = "Returns downloaded artifact")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact downloaded",
+ @Operation(description = "Download component artifact", method = "GET", summary = "Returns downloaded artifact",
+ responses = {@ApiResponse(responseCode = "200", description = "Artifact downloaded",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
- @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
- @ApiResponse(responseCode = "401",
- description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
- @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
- @ApiResponse(responseCode = "404", description = "Specified resource is not found - SVC4063"),
- @ApiResponse(responseCode = "405",
- description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
- @ApiResponse(responseCode = "500",
- description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000"),
- @ApiResponse(responseCode = "404", description = "Artifact was not found - SVC4505")})
+ @ApiResponse(responseCode = "400",
+ description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
+ @ApiResponse(responseCode = "401",
+ description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
+ @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
+ @ApiResponse(responseCode = "404", description = "Specified resource is not found - SVC4063"),
+ @ApiResponse(responseCode = "405",
+ description = "Method Not Allowed: Invalid HTTP method type used (PUT,DELETE,POST will be rejected) - POL4050"),
+ @ApiResponse(responseCode = "500",
+ description = "The GET request failed either due to internal SDC problem or Cambria Service failure. ECOMP Component should continue the attempts to get the needed information - POL5000"),
+ @ApiResponse(responseCode = "404", description = "Artifact was not found - SVC4505")})
@PermissionAllowed(AafPermission.PermNames.DELETE_VALUE)
public Response downloadComponentArtifact(
@Parameter(description = "The user ID of the DCAE Designer. This user must also have Designer role in SDC",
@@ -945,9 +931,8 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet {
@Path("/{assetType}/{uuid}/resourceInstances/{resourceInstanceName}/artifacts/{artifactUUID}")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Operation(description = "Download resource instance artifact", method = "GET",
- summary = "Returns downloaded artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {
+ summary = "Returns downloaded artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
@ApiResponse(responseCode = "200", description = "Artifact downloaded",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
index 8ad80d8724..db065ac223 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.externalapi.servlet;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogicProvider;
@@ -94,9 +95,8 @@ import static org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum.RESOURCE;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-// for retrieving component metadata.")
-@OpenAPIDefinition(info = @Info(title = "Asset Metadata External Servlet",
- description = "This Servlet serves external users for retrieving component metadata."))
+@Tags({@Tag(name = "SDC External APIs")})
+@Servers({@Server(url = "/sdc")})
@Controller
public class AssetsDataServlet extends AbstractValidationsServlet {
@@ -127,8 +127,7 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
@GET
@Path("/{assetType}")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Fetch list of assets", method = "GET", summary = "Returns list of assets")
- @ApiResponses(value = {
+ @Operation(description = "Fetch list of assets", method = "GET", summary = "Returns list of assets", responses = {
@ApiResponse(responseCode = "200",
description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = AssetMetadata.class)))),
@@ -249,11 +248,9 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
@Path("/{assetType}/{uuid}/metadata")
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Detailed metadata of asset by uuid", method = "GET",
- summary = "Returns detailed metadata of an asset by uuid")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200",
- description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = AssetMetadata.class)))),
+ summary = "Returns detailed metadata of an asset by uuid", responses = {@ApiResponse(responseCode = "200",
+ description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = AssetMetadata.class)))),
@ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
@ApiResponse(responseCode = "401",
description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
@@ -359,10 +356,8 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
@GET
@Path("/{assetType}/{uuid}/toscaModel")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
- @Operation(description = "Fetch assets CSAR", method = "GET", summary = "Returns asset csar",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
+ @Operation(description = "Fetch assets CSAR", method = "GET", summary = "Returns asset csar", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "200",
description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/CrudExternalServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/CrudExternalServlet.java
index 2508c3855c..0c2f673fcf 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/CrudExternalServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/CrudExternalServlet.java
@@ -23,17 +23,16 @@ package org.openecomp.sdc.be.externalapi.servlet;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.StringUtils;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
@@ -105,9 +104,8 @@ import static com.google.common.base.Strings.isNullOrEmpty;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "CRUD External Servlet",
- description = "This Servlet serves external users for creating assets and changing their lifecycle state"))
-
+@Tags({@Tag(name = "SDC External APIs")})
+@Servers({@Server(url = "/sdc")})
@Controller
public class CrudExternalServlet extends AbstractValidationsServlet {
@@ -152,8 +150,11 @@ public class CrudExternalServlet extends AbstractValidationsServlet {
@Path("/{assetType}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "creates an asset (resource or service)", method = "POST", summary = "Creates an asset (resource or service)")
- @ApiResponses(value = {
+ @Operation(parameters = {
+ @Parameter(required = true, schema = @Schema(implementation = org.openecomp.sdc.be.model.Resource.class),
+ description = "json describe the created resource")},
+ description = "creates an asset (resource or service)", method = "POST",
+ summary = "Creates an asset (resource or service)", responses = {
@ApiResponse(responseCode = "200", description = "ECOMP component is authenticated and Asset created",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
@ApiResponse(responseCode = "400", description = "Missing X-ECOMP-InstanceID HTTP header - POL5001"),
@@ -195,8 +196,8 @@ public class CrudExternalServlet extends AbstractValidationsServlet {
@ApiResponse(responseCode = "400",
description = "Create VFCMT request: VFCMT name exceeds character limit - SVC4073"),
@ApiResponse(responseCode = "400", description = "Invalid Content. Missing PROJECT_CODE number - SVC4129"),
- @ApiResponse(responseCode = "409", description = "Error: %1 (Service) with name '%2' already exists. - SVC4050")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.Resource", paramType = "body", value = "json describe the created resource")})
+ @ApiResponse(responseCode = "409",
+ description = "Error: %1 (Service) with name '%2' already exists. - SVC4050")})
@PermissionAllowed(AafPermission.PermNames.WRITE_VALUE)
public Response createComponentExternal(
@Parameter(description = "Determines the format of the body of the request",
@@ -385,8 +386,10 @@ public class CrudExternalServlet extends AbstractValidationsServlet {
@Path("/{assetType}/{uuid}/lifecycleState/{lifecycleOperation}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Change Resource lifecycle State", method = "POST")
- @ApiResponses(value = {
+ @Operation(parameters = {
+ @Parameter(required = true, schema = @Schema(implementation = org.openecomp.sdc.be.model.Resource.class),
+ description = "json describe the created resource")},
+ description = "Change Resource lifecycle State", method = "POST", responses = {
@ApiResponse(responseCode = "200", description = "Resource state changed",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = AssetMetadata.class)))),
@ApiResponse(responseCode = "400", description = "Missing X-ECOMP-InstanceID HTTP header - POL5001"),
@@ -402,8 +405,6 @@ public class CrudExternalServlet extends AbstractValidationsServlet {
@ApiResponse(responseCode = "403", description = "Asset is already checked-out by another user - SVC4085"),
@ApiResponse(responseCode = "403",
description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4080")})
- // @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction", paramType = "body", value = "userRemarks - Short description (free text) about the asset version being changed")})
- @ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction", paramType = "body", value = "userRemarks - Short description (free text) about the asset version being changed")})
@PermissionAllowed(AafPermission.PermNames.WRITE_VALUE)
public Response changeResourceStateExternal(
@Parameter(description = "Determines the format of the body of the request",
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServlet.java
index 0603aa8dad..121460c1f5 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServlet.java
@@ -21,6 +21,10 @@
package org.openecomp.sdc.be.externalapi.servlet;
import fj.data.Either;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ExternalRefsBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -51,6 +55,8 @@ import java.util.List;
import java.util.Map;
@Path("/v1/catalog")
+@Tags({@Tag(name = "SDC External APIs")})
+@Servers({@Server(url = "/sdc")})
@Controller
public class ExternalRefsServlet extends BeGenericServlet {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ServiceActivationServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ServiceActivationServlet.java
index be65a202a7..929d77e0fc 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ServiceActivationServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ServiceActivationServlet.java
@@ -23,12 +23,13 @@ package org.openecomp.sdc.be.externalapi.servlet;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -71,7 +72,8 @@ import java.io.IOException;
@SuppressWarnings("ALL")
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Service Activation External Servlet", description = "This Servlet serves external users for activating a specific service"))
+@Tags({@Tag(name = "SDC External APIs")})
+@Servers({@Server(url = "/sdc")})
@Controller
public class ServiceActivationServlet extends AbstractValidationsServlet {
@@ -99,8 +101,7 @@ public class ServiceActivationServlet extends AbstractValidationsServlet {
@Path("/services/{serviceUUID}/distribution/{opEnvId}/activate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "activate a service", method = "POST", summary = "Activates a service")
- @ApiResponses(value = {
+ @Operation(description = "activate a service", method = "POST", summary = "Activates a service", responses = {
@ApiResponse(responseCode = "202",
description = "ECOMP component is authenticated and required service may be distributed"),
@ApiResponse(responseCode = "400", description = "Missing X-ECOMP-InstanceID HTTP header - POL5001"),
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java
index b776f7ecf7..574d200382 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -65,7 +66,8 @@ import javax.ws.rs.core.Response;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Additional Information Servlet", description = "Additional Information Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class AdditionalInformationServlet extends BeGenericServlet {
@@ -97,9 +99,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Additional Information Label and Value", method = "POST",
- summary = "Returns created Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Additional information created"),
+ summary = "Returns created Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Additional information created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -129,9 +131,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Additional Information Label and Value", method = "POST",
- summary = "Returns created Additional Inforamtion property",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Additional information created"),
+ summary = "Returns created Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Additional information created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -161,9 +163,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Additional Information Label and Value", method = "PUT",
- summary = "Returns updated Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information updated"),
+ summary = "Returns updated Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Additional information updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -194,9 +196,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Additional Information Label and Value", method = "PUT",
- summary = "Returns updated Additional Inforamtion property",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information updated"),
+ summary = "Returns updated Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Additional information updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -226,9 +228,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Additional Information Label and Value", method = "DELETE",
- summary = "Returns deleted Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information deleted"),
+ summary = "Returns deleted Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Additional information deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -257,9 +259,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Additional Information Label and Value", method = "DELETE",
- summary = "Returns deleted Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Additional information deleted"),
+ summary = "Returns deleted Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Additional information deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -287,9 +289,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Additional Information by id", method = "GET",
- summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "fetched additional information"),
+ summary = "Returns Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "fetched additional information"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -317,9 +319,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Additional Information by id", method = "GET",
- summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "fetched additional information"),
+ summary = "Returns Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "fetched additional information"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -346,9 +348,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get all Additional Information under resource", method = "GET",
- summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "list of additional information"),
+ summary = "Returns Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "list of additional information"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
@@ -374,9 +376,9 @@ public class AdditionalInformationServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get all Additional Information under service", method = "GET",
- summary = "Returns Additional Inforamtion property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "list of additional information"),
+ summary = "Returns Additional Inforamtion property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "list of additional information"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Additional information key already exist")})
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArchiveEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArchiveEndpoint.java
index 8c3ca37524..1ab30b115c 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArchiveEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArchiveEndpoint.java
@@ -21,14 +21,15 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ArchiveBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -61,7 +62,8 @@ import java.util.Map;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Archive Endpoint"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -80,15 +82,14 @@ public class ArchiveEndpoint extends BeGenericServlet{
@POST
@Path("/resources/{componentId}/archive")
- @Operation(description = "Archive Resource", method = "POST", summary = "Marks a resource as archived. Can be restored with restore action", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
+ @Operation(description = "Archive Resource", method = "POST",
+ summary = "Marks a resource as archived. Can be restored with restore action", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "200", description = "Archive successful"),
@ApiResponse(responseCode = "400", description = "Bad request"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Resource not found"),
- @ApiResponse(responseCode = "500", description = "Internal Error")
- })
+ @ApiResponse(responseCode = "500", description = "Internal Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response archiveResources(@PathParam("componentId") final String componentId, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
loggerSupportability.log(LoggerSupportabilityActions.ARCHIVE,StatusCode.STARTED,"Archive Resource " + COMPONENT_ID + " " + componentId + " by "+ userId);
@@ -99,15 +100,14 @@ public class ArchiveEndpoint extends BeGenericServlet{
@POST
@Path("/resources/{componentId}/restore")
- @Operation(description = "Restore Resource", method = "POST", summary = "Restores a resource from archive.", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Restore successful"),
- @ApiResponse(responseCode = "400", description = "Bad request"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Resource not found"),
- @ApiResponse(responseCode = "500", description = "Internal Error")
- })
+ @Operation(description = "Restore Resource", method = "POST", summary = "Restores a resource from archive.",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "200", description = "Restore successful"),
+ @ApiResponse(responseCode = "400", description = "Bad request"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Resource not found"),
+ @ApiResponse(responseCode = "500", description = "Internal Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response restoreResource(@PathParam("componentId") final String componentId, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
loggerSupportability.log(LoggerSupportabilityActions.RESTORE_FROM_ARCHIVE,StatusCode.STARTED,"Restore resource from archive " + COMPONENT_ID + " " + componentId + " by "+ userId);
@@ -118,15 +118,14 @@ public class ArchiveEndpoint extends BeGenericServlet{
@POST
@Path("/services/{componentId}/archive")
- @Operation(description = "Archive Service", method = "POST", summary = "Marks a service as archived. Can be restored with restore action",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
+ @Operation(description = "Archive Service", method = "POST",
+ summary = "Marks a service as archived. Can be restored with restore action", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "200", description = "Archive successful"),
@ApiResponse(responseCode = "400", description = "Bad request"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found"),
- @ApiResponse(responseCode = "500", description = "Internal Error")
- })
+ @ApiResponse(responseCode = "500", description = "Internal Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response archiveService(@PathParam("componentId") final String componentId, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
loggerSupportability.log(LoggerSupportabilityActions.ARCHIVE, StatusCode.STARTED, "Archive Service for " + COMPONENT_ID + " " + componentId + " by " + userId);
@@ -138,15 +137,14 @@ public class ArchiveEndpoint extends BeGenericServlet{
@POST
@Path("/services/{componentId}/restore")
- @Operation(description = "Restore Service", method = "POST", summary = "Restores a service from archive.", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Restore successful"),
- @ApiResponse(responseCode = "400", description = "Bad request"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Service not found"),
- @ApiResponse(responseCode = "500", description = "Internal Error")
- })
+ @Operation(description = "Restore Service", method = "POST", summary = "Restores a service from archive.",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "200", description = "Restore successful"),
+ @ApiResponse(responseCode = "400", description = "Bad request"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Service not found"),
+ @ApiResponse(responseCode = "500", description = "Internal Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response restoreService(@PathParam("componentId") final String componentId, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
loggerSupportability.log(LoggerSupportabilityActions.RESTORE_FROM_ARCHIVE,StatusCode.STARTED,"Restore service from archive " + COMPONENT_ID + " " + componentId + " by "+ userId);
@@ -157,14 +155,13 @@ public class ArchiveEndpoint extends BeGenericServlet{
@GET
@Path("/archive")
- @Operation(description = "Get all Archived Components", method = "GET", summary = "Get all Archived Components", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Success"),
- @ApiResponse(responseCode = "400", description = "Bad request"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "500", description = "Internal Error")
- })
+ @Operation(description = "Get all Archived Components", method = "GET", summary = "Get all Archived Components",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "200", description = "Success"),
+ @ApiResponse(responseCode = "400", description = "Bad request"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "500", description = "Internal Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Map<String, List<CatalogComponent>> getArchivedComponents(@HeaderParam(value = Constants.USER_ID_HEADER) String userId){
return this.archiveBusinessLogic.getArchiveComponents(userId, new LinkedList<>());
@@ -172,13 +169,12 @@ public class ArchiveEndpoint extends BeGenericServlet{
@POST
@Path("/notif/vsp/archived")
- @Operation(description = "Notify about an archived VSP. All VFs with relation to the given CSAR IDs will be martked as vspArchived=true", method = "POST")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Success"),
+ @Operation(
+ description = "Notify about an archived VSP. All VFs with relation to the given CSAR IDs will be martked as vspArchived=true",
+ method = "POST", responses = {@ApiResponse(responseCode = "200", description = "Success"),
@ApiResponse(responseCode = "400", description = "Bad request"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "500", description = "Internal Error. A list of the failed CSAR IDs may be returned.")
- })
+ @ApiResponse(responseCode = "403", description = "Restricted operation"), @ApiResponse(responseCode = "500",
+ description = "Internal Error. A list of the failed CSAR IDs may be returned.")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response onVspArchived(@HeaderParam(value = Constants.USER_ID_HEADER) String userId, @RequestBody List<String> csarIds){
List<String> failedCsarIds = this.archiveBusinessLogic.onVspArchive(userId, csarIds);
@@ -195,13 +191,12 @@ public class ArchiveEndpoint extends BeGenericServlet{
@POST
@Path("/notif/vsp/restored")
- @Operation(description = "Notify about a restored VSP. All VFs with relation to the given CSAR IDs will be martked as vspArchived=false", method = "POST")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Success"),
+ @Operation(
+ description = "Notify about a restored VSP. All VFs with relation to the given CSAR IDs will be martked as vspArchived=false",
+ method = "POST", responses = {@ApiResponse(responseCode = "200", description = "Success"),
@ApiResponse(responseCode = "400", description = "Bad request"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "500", description = "Internal Error. A list of the failed CSAR IDs may be returned.")
- })
+ @ApiResponse(responseCode = "403", description = "Restricted operation"), @ApiResponse(responseCode = "500",
+ description = "Internal Error. A list of the failed CSAR IDs may be returned.")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response onVspRestored(@HeaderParam(value = Constants.USER_ID_HEADER) String userId, @RequestBody List<String> csarIds){
List<String> failedCsarIds = this.archiveBusinessLogic.onVspRestore(userId, csarIds);
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java
index ebb576fd6c..ab914dc930 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
@@ -73,7 +74,8 @@ import java.util.Map;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Resource Artifact Servlet", description = "Resource Artifact Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ArtifactServlet extends BeGenericServlet {
@@ -99,11 +101,12 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Artifact", method = "POST", summary = "Returns created ArtifactDefinition",
- responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Artifact already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Artifact already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response loadArtifact(@PathParam("resourceId") final String resourceId,
@Parameter(description = "json describe the artifact", required = true) String data,
@@ -118,9 +121,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/resources/{resourceId}/artifacts/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Update Artifact", method = "POST", summary = "Returns updated artifact",
- responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
+ @Operation(description = "Update Artifact", method = "POST", summary = "Returns updated artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -144,10 +147,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/resources/{resourceId}/artifacts/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Delete Artifact", method = "DELETE",
- summary = "Returns delete artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
+ @Operation(description = "Delete Artifact", method = "DELETE", summary = "Returns delete artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -169,12 +171,13 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/services/{serviceId}/artifacts")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Create Artifact", method = "POST",
- summary = "Returns created ArtifactDefinition", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Artifact already exist")})
+ @Operation(description = "Create Artifact", method = "POST", summary = "Returns created ArtifactDefinition",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Artifact already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response loadInformationArtifact(@PathParam("serviceId") final String serviceId,
@Parameter(description = "json describe the artifact", required = true) String data,
@@ -195,10 +198,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/services/{serviceId}/artifacts/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Update Artifact", method = "POST",
- summary = "Returns updated artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service artifact created"),
+ @Operation(description = "Update Artifact", method = "POST", summary = "Returns updated artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service artifact created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
public Response updateInformationArtifact(@PathParam("serviceId") final String serviceId,
@@ -222,12 +224,12 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/services/{serviceId}/artifacts/api/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Update Api Artifact", method = "POST",
- summary = "Returns created ArtifactDefinition", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Api Artifact Updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Update Api Artifact", method = "POST", summary = "Returns created ArtifactDefinition",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Api Artifact Updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateApiArtifact(@PathParam("serviceId") final String serviceId,
@PathParam("artifactId") final String artifactId,
@@ -250,11 +252,11 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/services/{serviceId}/artifacts/api/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Delete Api Artifact", method = "DELETE",
- summary = "Returns Deleted ArtifactDefinition", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Api Artifact deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation")})
+ @Operation(description = "Delete Api Artifact", method = "DELETE", summary = "Returns Deleted ArtifactDefinition",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "204", description = "Api Artifact deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteApiArtifact(@PathParam("serviceId") final String serviceId,
@PathParam("artifactId") final String artifactId, @Context final HttpServletRequest request,
@@ -276,10 +278,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/services/{serviceId}/artifacts/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Delete Artifact", method = "DELETE",
- summary = "Returns delete artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service artifact deleted"),
+ @Operation(description = "Delete Artifact", method = "DELETE", summary = "Returns delete artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service artifact deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -306,9 +307,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Download service Artifact in Base64", method = "GET",
- summary = "Returns downloaded artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service artifact downloaded"),
+ summary = "Returns downloaded artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Service artifact downloaded"),
@ApiResponse(responseCode = "404", description = "Service/Artifact not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response downloadServiceArtifactBase64(@PathParam("serviceId") final String serviceId,
@@ -335,9 +336,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Download resource Artifact in Base64", method = "GET",
- summary = "Returns downloaded artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource artifact downloaded"),
+ summary = "Returns downloaded artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource artifact downloaded"),
@ApiResponse(responseCode = "404", description = "Resource/Artifact not found")})
public Response downloadResourceArtifactBase64(@PathParam("resourceId") final String resourceId,
@PathParam("artifactId") final String artifactId, @Context final HttpServletRequest request) {
@@ -364,9 +365,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Download component Artifact in Base64", method = "GET",
- summary = "Returns downloaded artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "ResourceInstance artifact downloaded"),
+ summary = "Returns downloaded artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "ResourceInstance artifact downloaded"),
@ApiResponse(responseCode = "404", description = "ResourceInstance/Artifact not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response downloadResourceInstanceArtifactBase64(@Parameter(
@@ -401,9 +402,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Artifact and Attach to interface", method = "POST",
- summary = "Returns created resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
+ summary = "Returns created resource", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Artifact already exist")})
@@ -432,9 +433,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "delete Artifact from interface", method = "delete",
- summary = "delete matching artifact from interface", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "delete artifact under interface deleted"),
+ summary = "delete matching artifact from interface", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "delete artifact under interface deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Artifact already exist")})
@@ -459,9 +460,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "update Artifact Attach to interface", method = "post",
- summary = "updates artifact by interface", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "delete artifact under interface deleted"),
+ summary = "updates artifact by interface", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "delete artifact under interface deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Artifact already exist")})
@@ -488,10 +489,10 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/{containerComponentType}/{componentId}/resourceInstance/{componentInstanceId}/artifacts/{artifactId}/heatParams")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Update Resource Instance HEAT_ENV parameters",
- method = "POST", summary = "Returns updated artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Artifact updated"),
+ @Operation(description = "Update Resource Instance HEAT_ENV parameters", method = "POST",
+ summary = "Returns updated artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Artifact updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -526,9 +527,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Resource Instance artifact payload", method = "POST",
- summary = "Returns updated artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Artifact updated"),
+ summary = "Returns updated artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Artifact updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -558,9 +559,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Load Resource Instance artifact payload", method = "POST",
- summary = "Returns updated artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Artifact updated"),
+ summary = "Returns updated artifact", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Artifact updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -588,12 +589,12 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/{containerComponentType}/{componentId}/resourceInstance/{componentInstanceId}/artifacts/{artifactId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Delete Resource Instance artifact", method = "POST",
- summary = "Returns deleted artifact", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Artifact updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Delete Resource Instance artifact", method = "POST", summary = "Returns deleted artifact",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Artifact updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteComponentInstanceArtifact(@HeaderParam(value = Constants.USER_ID_HEADER) String userId,
@HeaderParam(value = Constants.MD5_HEADER) String origMd5,
@@ -628,10 +629,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/{containerComponentType}/{componentId}/artifactsByType/{artifactGroupType}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get component Artifacts", method = "GET",
- summary = "Returns artifacts", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component artifacts"),
+ @Operation(description = "Get component Artifacts", method = "GET", summary = "Returns artifacts", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Component artifacts"),
@ApiResponse(responseCode = "404", description = "Resource/Artifact not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getComponentArtifacts(@Parameter(description = "valid values: resources / services",
@@ -655,10 +655,9 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/{containerComponentType}/{componentId}/resourceInstances/{componentInstanceId}/artifactsByType/{artifactGroupType}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get component Artifacts", method = "GET",
- summary = "Returns artifacts", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component artifacts"),
+ @Operation(description = "Get component Artifacts", method = "GET", summary = "Returns artifacts", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Component artifacts"),
@ApiResponse(responseCode = "404", description = "Resource/Artifact not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getComponentInstanceArtifacts(@Parameter(description = "valid values: resources / services",
@@ -684,17 +683,21 @@ public class ArtifactServlet extends BeGenericServlet {
@Path("/{assetType}/{uuid}/interfaces/{interfaceUUID}/operations/{operationUUID}/artifacts/{artifactUUID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "uploads of artifact to component operation workflow", method = "POST", summary = "uploads of artifact to component operation workflow")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Artifact uploaded",content = @Content(array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
+ @Operation(description = "uploads of artifact to component operation workflow", method = "POST",
+ summary = "uploads of artifact to component operation workflow", responses = {
+ @ApiResponse(responseCode = "200", description = "Artifact uploaded", content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ArtifactDefinition.class)))),
@ApiResponse(responseCode = "404", description = "Specified resource is not found - SVC4063"),
@ApiResponse(responseCode = "400", description = "Invalid artifactType was defined as input - SVC4122"),
- @ApiResponse(responseCode = "400", description = "Artifact type (mandatory field) is missing in request - SVC4124"),
- @ApiResponse(responseCode = "400", description = "Artifact name given in input already exists in the context of the asset - SVC4125"),
+ @ApiResponse(responseCode = "400",
+ description = "Artifact type (mandatory field) is missing in request - SVC4124"),
+ @ApiResponse(responseCode = "400",
+ description = "Artifact name given in input already exists in the context of the asset - SVC4125"),
@ApiResponse(responseCode = "400", description = "Artifact name is missing in input - SVC4128"),
- @ApiResponse(responseCode = "400", description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
- @ApiResponse(responseCode = "400", description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
- //@ApiImplicitParams({@ApiImplicitParam(required = true, dataType = "org.openecomp.sdc.be.model.ArtifactDefinition", paramType = "body", value = "json describe the artifact")})
+ @ApiResponse(responseCode = "400",
+ description = "Asset is being edited by different user. Only one user can checkout and edit an asset on given time. The asset will be available for checkout after the other user will checkin the asset - SVC4086"),
+ @ApiResponse(responseCode = "400",
+ description = "Restricted Operation – the user provided does not have role of Designer or the asset is being used by another designer - SVC4301")})
public Response uploadInterfaceOperationArtifact(
@Parameter(description = "Asset type") @PathParam("assetType") String assetType,
@Parameter(description = "The uuid of the asset as published in the metadata", required = true)@PathParam("uuid") final String uuid,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
index aad7f1a8bf..3050128531 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
@@ -24,15 +24,16 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.AttributeBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -75,7 +76,8 @@ import java.io.IOException;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Resource Attribute Servlet", description = "Resource Attribute Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class AttributeServlet extends AbstractValidationsServlet {
private static final Logger log = Logger.getLogger(AttributeServlet.class);
@@ -102,9 +104,9 @@ public class AttributeServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Resource Attribute", method = "POST",
- summary = "Returns created resource attribute", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource property created"),
+ summary = "Returns created resource attribute", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource property created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Resource attribute already exist")})
@@ -171,11 +173,11 @@ public class AttributeServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Resource Attribute", method = "PUT", summary = "Returns updated attribute",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource attribute updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource attribute updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateAttribute(
@Parameter(description = "resource id to update with new attribute",
@@ -248,12 +250,12 @@ public class AttributeServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Resource Attribute", method = "DELETE", summary = "Returns deleted attribute",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "deleted attribute"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Resource property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "204", description = "deleted attribute"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Resource property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteAttribute(
@Parameter(description = "resource id of attribute",
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpoint.java
index 440b72a907..3602003815 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpoint.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
import org.openecomp.sdc.be.components.upgrade.UpgradeBusinessLogic;
@@ -59,7 +60,8 @@ import java.util.List;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "policy types resource"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -80,9 +82,9 @@ public class AutomatedUpgradeEndpoint extends BeGenericServlet {
@Path("/{componentType}/{componentId}/automatedupgrade")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Autometed upgrade", method = "POST", summary = "....", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Autometed upgrade", method = "POST", summary = "....", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -116,9 +118,9 @@ public class AutomatedUpgradeEndpoint extends BeGenericServlet {
@Path("/{componentType}/{componentId}/dependencies")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Autometed upgrade", method = "POST", summary = "....", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Autometed upgrade", method = "POST", summary = "....", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -136,7 +138,5 @@ public class AutomatedUpgradeEndpoint extends BeGenericServlet {
log.error("#getServicesForComponent - Exception occurred during autometed Upgrade", e);
throw e;
}
-
-
}
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
index 39733c9986..b497b702c3 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
@@ -28,6 +28,9 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import fj.data.Either;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.servers.Server;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
@@ -93,6 +96,9 @@ import java.util.Objects;
import java.util.Set;
import java.util.function.Supplier;
+@OpenAPIDefinition(info = @Info(title = "SDC API", description = "SDC External, Distribution and Internal APIs"),
+ servers = {@Server(url = "/sdc", description = "SDC External and Distribution APIs"),
+ @Server(url = "/sdc2/rest", description = "SDC Internal APIs")})
public class BeGenericServlet extends BasicServlet {
public BeGenericServlet(UserBusinessLogic userAdminManager,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java
index e34034671e..89456ccca6 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java
@@ -23,14 +23,15 @@ package org.openecomp.sdc.be.servlets;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.tuple.Pair;
import org.openecomp.sdc.be.components.health.HealthCheckBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
@@ -59,7 +60,8 @@ import java.util.List;
@Loggable(prepend = true, value = Loggable.TRACE, trim = false)
@Path("/")
-@OpenAPIDefinition(info = @Info(title = "BE Monitoring", description = "BE Monitoring"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class BeMonitoringServlet extends BeGenericServlet {
@@ -80,10 +82,10 @@ public class BeMonitoringServlet extends BeGenericServlet {
@Path("/healthCheck")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Return aggregate BE health check of SDC BE components", summary = "return BE health check",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "SDC BE components are all up"),
+ @Operation(description = "Return aggregate BE health check of SDC BE components",
+ summary = "return BE health check", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "200", description = "SDC BE components are all up"),
@ApiResponse(responseCode = "500", description = "One or more SDC BE components are down")})
public Response getHealthCheck(@Context final HttpServletRequest request) {
try {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/CapabilityServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/CapabilityServlet.java
index e576337c4d..999c172bca 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/CapabilityServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/CapabilityServlet.java
@@ -18,15 +18,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.CapabilitiesBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -69,7 +70,8 @@ import java.util.Optional;
@Path("/v1/catalog")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Capability Servlet", description = "Capability Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class CapabilityServlet extends AbstractValidationsServlet {
private static final Logger LOGGER = Logger.getLogger(CapabilityServlet.class);
@@ -91,9 +93,9 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/capabilities")
@Operation(description = "Create Capabilities on resource", method = "POST",
- summary = "Create Capabilities on resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Capabilities"),
+ summary = "Create Capabilities on resource", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Capabilities"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Capability already exist")})
@@ -112,9 +114,9 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/capabilities")
@Operation(description = "Update Capabilities on resource", method = "PUT",
- summary = "Update Capabilities on resource",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Update Capabilities"),
+ summary = "Update Capabilities on resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Update Capabilities"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -131,12 +133,12 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/capabilities/{capabilityId}")
- @Operation(description = "Get Capability from resource", method = "GET",
- summary = "GET Capability from resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "GET Capability"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Get Capability from resource", method = "GET", summary = "GET Capability from resource",
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "GET Capability"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getCapabilityOnResource(
@Parameter(description = "Resource Id") @PathParam("resourceId") String resourceId,
@@ -152,9 +154,9 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/capabilities/{capabilityId}")
@Operation(description = "Delete capability from resource", method = "DELETE",
- summary = "Delete capability from resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete capability"),
+ summary = "Delete capability from resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete capability"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -171,9 +173,9 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/capabilities")
@Operation(description = "Create Capabilities on service", method = "POST",
- summary = "Create Capabilities on service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Capabilities"),
+ summary = "Create Capabilities on service", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Capabilities"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Capability already exist")})
@@ -192,9 +194,9 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/capabilities")
@Operation(description = "Update Capabilities on service", method = "PUT",
- summary = "Update Capabilities on service",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Update Capabilities"),
+ summary = "Update Capabilities on service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Update Capabilities"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -211,12 +213,12 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/capabilities/{capabilityId}")
- @Operation(description = "Get Capability from service", method = "GET",
- summary = "GET Capability from service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "GET Capability"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Get Capability from service", method = "GET", summary = "GET Capability from service",
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "GET Capability"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getCapabilityOnService(
@Parameter(description = "Service Id") @PathParam("serviceId") String serviceId,
@@ -232,9 +234,9 @@ public class CapabilityServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/capabilities/{capabilityId}")
@Operation(description = "Delete capability from service", method = "DELETE",
- summary = "Delete capability from service",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete capability"),
+ summary = "Delete capability from service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = CapabilityDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete capability"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
index 6fa16f8681..a8d3bc0670 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java
@@ -28,15 +28,16 @@ import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
@@ -106,7 +107,8 @@ import java.util.Set;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Resource Instance Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ComponentInstanceServlet extends AbstractValidationsServlet {
@@ -150,12 +152,12 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create ComponentInstance", method = "POST", summary = "Returns created ComponentInstance",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Component created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Component instance already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Component created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Component instance already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createComponentInstance(@Parameter(description = "RI object to be created", required = true) String data,
@PathParam("componentId") final String containerComponentId,
@@ -193,11 +195,11 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance", method = "POST", summary = "Returns updated resource instance",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource instance updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource instance updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateComponentInstanceMetadata(@PathParam("componentId") final String componentId,
@PathParam("componentInstanceId") final String componentInstanceId,
@@ -286,9 +288,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance multiple component", method = "POST",
- summary = "Returns updated resource instance", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource instance updated"),
+ summary = "Returns updated resource instance", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource instance updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -346,11 +348,11 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete ResourceInstance", method = "DELETE", summary = "Returns delete resourceInstance",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "ResourceInstance deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "ResourceInstance deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteResourceInstance(@PathParam("componentId") final String componentId,
@PathParam("resourceInstanceId") final String resourceInstanceId,
@@ -391,12 +393,12 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Associate RI to RI", method = "POST", summary = "Returns created RelationshipInfo",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Relationship created"),
- @ApiResponse(responseCode = "403", description = "Missing information"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Relationship already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Relationship created"),
+ @ApiResponse(responseCode = "403", description = "Missing information"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Relationship already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response associateRIToRI(@Parameter(
description = "unique id of the container component") @PathParam("componentId") final String componentId,
@@ -444,11 +446,11 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Dissociate RI from RI", method = "PUT", summary = "Returns deleted RelationshipInfo",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Relationship deleted"),
- @ApiResponse(responseCode = "403", description = "Missing information"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Relationship deleted"),
+ @ApiResponse(responseCode = "403", description = "Missing information"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response dissociateRIFromRI(
@Parameter(description = "allowed values are resources /services / products",
@@ -491,9 +493,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create RI and associate RI to RI", method = "POST",
- summary = "Returns created RI and RelationshipInfo", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "RI created"),
+ summary = "Returns created RI and RelationshipInfo", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "RI created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Relationship already exist")})
@@ -558,9 +560,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance property", method = "POST",
- summary = "Returns updated resource instance property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource instance created"),
+ summary = "Returns updated resource instance property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource instance created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -624,9 +626,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance property", method = "POST",
- summary = "Returns updated resource instance property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource instance created"),
+ summary = "Returns updated resource instance property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource instance created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -701,9 +703,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance attribute", method = "POST",
- summary = "Returns updated resource instance attribute", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource instance created"),
+ summary = "Returns updated resource instance attribute", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource instance created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -764,9 +766,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance", method = "DELETE",
- summary = "Returns deleted resource instance property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource instance created"),
+ summary = "Returns deleted resource instance property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource instance created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -812,11 +814,11 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance", method = "POST", summary = "Returns updated resource instance",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource instance created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource instance created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response changeResourceInstanceVersion(@PathParam("componentId") final String componentId,
@PathParam("componentInstanceId") final String componentInstanceId,
@@ -873,9 +875,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update resource instance property", method = "POST",
- summary = "Returns updated resource instance property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource instance created"),
+ summary = "Returns updated resource instance property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource instance created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -944,9 +946,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get group artifacts ", method = "GET",
- summary = "Returns artifacts metadata according to groupInstId", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "group found"),
+ summary = "Returns artifacts metadata according to groupInstId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "group found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Group not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -984,9 +986,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get component instance properties", method = "GET",
- summary = "Returns component instance properties", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Properties found"),
+ summary = "Returns component instance properties", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Properties found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component/Component Instance - not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -1009,9 +1011,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get component instance capability properties", method = "GET",
- summary = "Returns component instance capability properties", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Properties found"),
+ summary = "Returns component instance capability properties", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Properties found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component/Component Instance/Capability - not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -1048,13 +1050,12 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Instance Capabilty Property", method = "PUT",
- summary = "Returns updated property", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(
- value = {@ApiResponse(responseCode = "200", description = "Resource instance capabilty property updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Component/Component Instance/Capability - not found")})
+ summary = "Returns updated property", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource instance capabilty property updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Component/Component Instance/Capability - not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateInstanceCapabilityProperty(
@PathParam("containerComponentType") final String containerComponentType,
@@ -1105,12 +1106,12 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create service proxy", method = "POST", summary = "Returns created service proxy",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service proxy created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Service proxy already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service proxy created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Service proxy already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createServiceProxy(@Parameter(description = "RI object to be created", required = true) String data,
@PathParam("containerComponentId") final String containerComponentId,
@@ -1153,11 +1154,11 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete service proxy", method = "DELETE", summary = "Returns delete service proxy",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service proxy deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service proxy deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteServiceProxy(@PathParam("containerComponentId") final String containerComponentId,
@PathParam("serviceProxyId") final String serviceProxyId,
@@ -1194,9 +1195,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update service proxy with new version", method = "POST",
- summary = "Returns updated service proxy", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service proxy created"),
+ summary = "Returns updated service proxy", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service proxy created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -1247,9 +1248,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get relation", method = "GET",
- summary = "Returns relation metadata according to relationId",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "relation found"),
+ summary = "Returns relation metadata according to relationId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "relation found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Relation not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -1356,9 +1357,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@GET
@Path("/{containerComponentType}/{componentId}/paths-to-delete")
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Check if forwarding path to delete on version change", method = "GET", summary = "Returns forwarding paths to delete",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
+ @Operation(description = "Check if forwarding path to delete on version change", method = "GET",
+ summary = "Returns forwarding paths to delete", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class))))})
public Response changeResourceInstanceVersion( @PathParam("componentId") String componentId,
@QueryParam("componentInstanceId") final String oldComponentInstanceId,
@QueryParam("newComponentInstanceId") final String newComponentInstanceId,
@@ -1405,9 +1406,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Path("/services/{componentId}/copyComponentInstance/{componentInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces((MediaType.APPLICATION_JSON))
- @Operation(description = "Copy Component Instance", method = "POST", summary = "Returns updated service information",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = {
+ @Operation(description = "Copy Component Instance", method = "POST",
+ summary = "Returns updated service information", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
@ApiResponse(responseCode = "201", description = "Copy and Paste Success"),
@ApiResponse(responseCode = "403", description = "Restricted Operation"),
@ApiResponse(responseCode = "400", description = "Invalid Content / Missing content")})
@@ -1449,12 +1450,10 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Path("/{containerComponentType}/{componentId}/batchDeleteResourceInstances/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Batch Delete ResourceInstances", method = "POST")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "203", description = "ResourceInstances deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted Operation"),
- @ApiResponse(responseCode = "400", description = "Invalid Content / Missing Content")
- })
+ @Operation(description = "Batch Delete ResourceInstances", method = "POST",
+ responses = {@ApiResponse(responseCode = "203", description = "ResourceInstances deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted Operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid Content / Missing Content")})
public Response batchDeleteResourceInstances(
@Parameter(description = "valid values: resources / services / products", schema = @Schema(allowableValues = {ComponentTypeEnum.RESOURCE_PARAM_NAME,
ComponentTypeEnum.SERVICE_PARAM_NAME,
@@ -1503,9 +1502,9 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Batch Dissociate RI from RI", method = "PUT",
- summary = "Returns deleted RelationShip Info", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Relationship deleted"),
+ summary = "Returns deleted RelationShip Info", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Relationship deleted"),
@ApiResponse(responseCode = "403", description = "Missing Information"),
@ApiResponse(responseCode = "400", description = "Invalid Content / Missing Content")})
public Response batchDissociateRIFromRI(
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentPropertyServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentPropertyServlet.java
index 28f73af0f5..fcca3394a0 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentPropertyServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentPropertyServlet.java
@@ -18,15 +18,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -67,7 +68,8 @@ import java.util.Map;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Component Property Servlet", description = "Component Property Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Singleton
public class ComponentPropertyServlet extends BeGenericServlet {
@@ -95,12 +97,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Service Property", method = "POST", summary = "Returns created service property",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service property created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Service property already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service property created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Service property already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createPropertyInService(
@Parameter(description = "service id to update with new property",
@@ -116,12 +118,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Resource Property", method = "POST", summary = "Returns created service property",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource property created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Resource property already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource property created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Resource property already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createPropertyInResource(
@Parameter(description = "Resource id to update with new property",
@@ -138,12 +140,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Service Property", method = "GET", summary = "Returns property of service",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "property"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Service property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "property"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Service property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getPropertyInService(
@Parameter(description = "service id of property", required = true) @PathParam("serviceId") final String serviceId,
@@ -158,12 +160,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Resource Property", method = "GET", summary = "Returns property of resource",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "property"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Resource property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "property"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Resource property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getPropertyInResource(
@Parameter(description = "resource id of property",
@@ -179,12 +181,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Service Property", method = "GET", summary = "Returns property list of service",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "property"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Service property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "property"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Service property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getPropertyListInService(
@Parameter(description = "service id of property",
@@ -199,12 +201,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Resource Property", method = "GET", summary = "Returns property list of resource",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "property"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Resource property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "property"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Resource property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getPropertyListInResource(
@Parameter(description = "resource id of property",
@@ -219,12 +221,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete Service Property", method = "DELETE", summary = "Returns deleted property",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "deleted property"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Service property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "204", description = "deleted property"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Service property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deletePropertyInService(
@Parameter(description = "service id of property",
@@ -241,12 +243,12 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete Resource Property", method = "DELETE", summary = "Returns deleted property",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "deleted property"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Resource property not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "204", description = "deleted property"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Resource property not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deletePropertyInResource(
@Parameter(description = "resource id of property",
@@ -263,11 +265,11 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Service Property", method = "PUT", summary = "Returns updated property",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service property updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Service property updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updatePropertyInService(
@Parameter(description = "service id to update with new property",
@@ -283,11 +285,11 @@ public class ComponentPropertyServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Resource Property", method = "PUT", summary = "Returns updated property",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource property updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource property updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updatePropertyInResource(
@Parameter(description = "resource id to update with new property",
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java
index 6311520efb..6c5d603225 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogicProvider;
@@ -81,7 +82,8 @@ import static org.openecomp.sdc.common.util.GeneralUtility.getCategorizedCompone
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Component Servlet",description = "Component Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ComponentServlet extends BeGenericServlet {
private static final String GET_CERTIFIED_NOT_ABSTRACT_COMPONENTS_FAILED_WITH_EXCEPTION = "getCertifiedNotAbstractComponents failed with exception";
@@ -109,9 +111,9 @@ public class ComponentServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Validate Component Conformance Level", method = "GET",
- summary = "Returns the result according to conformance level in BE config", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ summary = "Returns the result according to conformance level in BE config", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -144,9 +146,9 @@ public class ComponentServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Component Requirments And Capabilities", method = "GET",
- summary = "Returns Requirements And Capabilities according to componentId", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ summary = "Returns Requirements And Capabilities according to componentId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -181,9 +183,9 @@ public class ComponentServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Component Requirments And Capabilities", method = "GET",
- summary = "Returns Requirments And Capabilities according to componentId", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ summary = "Returns Requirments And Capabilities according to componentId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -225,9 +227,9 @@ public class ComponentServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Component Requirments And Capabilities", method = "GET",
- summary = "Returns Requirments And Capabilities according to componentId", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ summary = "Returns Requirments And Capabilities according to componentId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -273,10 +275,9 @@ public class ComponentServlet extends BeGenericServlet {
@Path("/{componentType}/latestversion/notabstract/metadata")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get Component uid only", method = "GET", summary = "Returns componentId",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Get Component uid only", method = "GET", summary = "Returns componentId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -315,11 +316,11 @@ public class ComponentServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get Component instances", method = "GET", summary = "Returns component instances",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Component not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getComponentInstancesFilteredByPropertiesAndInputs(
@PathParam("componentType") final String componentType, @PathParam("componentId") final String componentId,
@@ -368,12 +369,12 @@ public class ComponentServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Resource", method = "GET", summary = "Returns resource according to resourceId",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Resource not found")})
@ResponseView(mixin = {GroupCompositionMixin.class, PolicyCompositionMixin.class})
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Resource not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getComponentDataFilteredByParams(@PathParam("componentType") final String componentType,
@PathParam("componentId") final String componentId,
@@ -419,11 +420,11 @@ public class ComponentServlet extends BeGenericServlet {
description = "Retrieve properties belonging to component instances of specific component by name and optionally resource type",
method = "GET",
summary = "Returns properties belonging to component instances of specific component by name and optionally resource type",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Component not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getFilteredComponentInstanceProperties(
@PathParam("componentType") final String componentType,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigMgrServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigMgrServlet.java
index a3365c5ea2..24eb5314f7 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigMgrServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigMgrServlet.java
@@ -21,6 +21,10 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
import org.openecomp.sdc.be.config.Configuration;
@@ -45,6 +49,8 @@ import javax.ws.rs.core.MediaType;
* Root resource (exposed at "/" path)
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Path("/configmgr")
public class ConfigMgrServlet extends BasicServlet {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigServlet.java
index 0735b9de33..86a8a2d352 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConfigServlet.java
@@ -21,10 +21,14 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
import org.openecomp.sdc.be.config.Configuration;
@@ -46,7 +50,8 @@ import javax.ws.rs.core.MediaType;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/config")
-@Api(value = "Get configuration", description = "Get configuration")
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
public class ConfigServlet extends BasicServlet {
private static final Logger log = Logger.getLogger(ConfigServlet.class);
@@ -55,8 +60,9 @@ public class ConfigServlet extends BasicServlet {
@Path("/get")
@Produces(MediaType.APPLICATION_JSON)
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
- @ApiOperation(value = "Retrieve configuration", httpMethod = "GET", notes = "Returns configuration", response = String.class)
- @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") })
+ @Operation(description = "Retrieve configuration", method = "GET", responses = {
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class)))
+ })
public String getConfig(@Context final HttpServletRequest request) {
String result = null;
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java
index 44b22a50f9..408efa12c6 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java
@@ -23,15 +23,16 @@ package org.openecomp.sdc.be.servlets;
import com.google.gson.Gson;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ConsumerBusinessLogic;
import org.openecomp.sdc.be.config.BeEcompErrorManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
@@ -62,7 +63,8 @@ import javax.ws.rs.core.Response;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/consumers")
-@OpenAPIDefinition(info = @Info(title = "Consumer Servlet",description = "Consumer Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Singleton
public class ConsumerServlet extends BeGenericServlet {
@@ -83,9 +85,9 @@ public class ConsumerServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Consumer credentials", method = "POST",
- summary = "Returns created ECOMP consumer credentials",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Consumer credentials created"),
+ summary = "Returns created ECOMP consumer credentials", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Consumer credentials created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
public Response createConsumer(@Parameter(description = "Consumer Object to be created", required = true) String data,
@@ -133,11 +135,11 @@ public class ConsumerServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Consumer", method = "GET", summary = "Returns consumer according to ConsumerID",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = ConsumerDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Consumer found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Consumer not found")})
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ConsumerDefinition.class)))),
+ @ApiResponse(responseCode = "200", description = "Consumer found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Consumer not found")})
public Response getConsumer(@PathParam("consumerId") final String consumerId,
@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -174,9 +176,9 @@ public class ConsumerServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Deletes Consumer", method = "DELETE",
- summary = "Returns deleted consumer according to ConsumerID", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = ConsumerDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Consumer deleted"),
+ summary = "Returns deleted consumer according to ConsumerID", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = ConsumerDefinition.class)))),
+ @ApiResponse(responseCode = "204", description = "Consumer deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Consumer not found")})
public Response deleteConsumer(@PathParam("consumerId") final String consumerId,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java
index a5a2768199..5ba56fda5b 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java
@@ -22,14 +22,15 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.DistributionMonitoringBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -61,7 +62,8 @@ import javax.ws.rs.core.Response;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Distribution Service Servlet",description = "Distribution Service Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class DistributionServiceServlet extends BeGenericServlet {
private static final Logger log = Logger.getLogger(DistributionServiceServlet.class);
@@ -82,11 +84,11 @@ public class DistributionServiceServlet extends BeGenericServlet {
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Distributions", method = "GET",
summary = "Returns list bases on the information extracted from Auditing Records according to service uuid",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = DistributionStatusListResponse.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Service not found")})
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = DistributionStatusListResponse.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Service not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getServiceById(@PathParam("serviceUUID") final String serviceUUID,
@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -124,10 +126,10 @@ public class DistributionServiceServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Distributions", method = "GET",
- summary = "Return the list of distribution status objects",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = DistributionStatusListResponse.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
+ summary = "Return the list of distribution status objects", responses = {@ApiResponse(
+ content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = DistributionStatusListResponse.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Status not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
index 4245fc813e..c350812ce4 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
@@ -22,15 +22,15 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ElementBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -92,7 +92,8 @@ import java.util.Map;
*
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
-@OpenAPIDefinition(info = @Info(title = "Element Servlet",description = "Element Servlet"))
+@Tags({@io.swagger.v3.oas.annotations.tags.Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ElementServlet extends BeGenericServlet {
@@ -132,13 +133,13 @@ public class ElementServlet extends BeGenericServlet {
@Operation(description = "Retrieve the list of all resource/service/product categories/sub-categories/groupings",
method = "GET",
summary = "Retrieve the list of all resource/service/product categories/sub-categories/groupings.",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns categories Ok"),
- @ApiResponse(responseCode = "403", description = "Missing information"),
- @ApiResponse(responseCode = "400", description = "Invalid component type"),
- @ApiResponse(responseCode = "409", description = "Restricted operation"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns categories Ok"),
+ @ApiResponse(responseCode = "403", description = "Missing information"),
+ @ApiResponse(responseCode = "400", description = "Invalid component type"),
+ @ApiResponse(responseCode = "409", description = "Restricted operation"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getComponentCategories(
@Parameter(description = "allowed values are resources / services/ products", schema = @Schema(allowableValues = {ComponentTypeEnum.RESOURCE_PARAM_NAME ,
@@ -194,13 +195,13 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create new component category", method = "POST",
- summary = "Create new component category")
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Category created"),
- @ApiResponse(responseCode = "400", description = "Invalid category data"),
- @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
- @ApiResponse(responseCode = "409",
- description = "Category already exists / User not permitted to perform the action"),
- @ApiResponse(responseCode = "500", description = "General Error")})
+ summary = "Create new component category",
+ responses = {@ApiResponse(responseCode = "201", description = "Category created"),
+ @ApiResponse(responseCode = "400", description = "Invalid category data"),
+ @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
+ @ApiResponse(responseCode = "409",
+ description = "Category already exists / User not permitted to perform the action"),
+ @ApiResponse(responseCode = "500", description = "General Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createComponentCategory(
@Parameter(description = "allowed values are resources /services / products",
@@ -233,13 +234,13 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete component category", method = "DELETE", summary = "Delete component category",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Category.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Category deleted"),
- @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
- @ApiResponse(responseCode = "409", description = "User not permitted to perform the action"),
- @ApiResponse(responseCode = "404", description = "Category not found"),
- @ApiResponse(responseCode = "500", description = "General Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Category.class)))),
+ @ApiResponse(responseCode = "204", description = "Category deleted"),
+ @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
+ @ApiResponse(responseCode = "409", description = "User not permitted to perform the action"),
+ @ApiResponse(responseCode = "404", description = "Category not found"),
+ @ApiResponse(responseCode = "500", description = "General Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteComponentCategory(@PathParam(value = "categoryUniqueId") final String categoryUniqueId,
@PathParam(value = "componentType") final String componentType, @Context final HttpServletRequest request,
@@ -274,14 +275,14 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create new component sub-category", method = "POST",
- summary = "Create new component sub-category for existing category")
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Subcategory created"),
- @ApiResponse(responseCode = "400", description = "Invalid subcategory data"),
- @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
- @ApiResponse(responseCode = "404", description = "Parent category wasn't found"),
- @ApiResponse(responseCode = "409",
- description = "Subcategory already exists / User not permitted to perform the action"),
- @ApiResponse(responseCode = "500", description = "General Error")})
+ summary = "Create new component sub-category for existing category",
+ responses = {@ApiResponse(responseCode = "201", description = "Subcategory created"),
+ @ApiResponse(responseCode = "400", description = "Invalid subcategory data"),
+ @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
+ @ApiResponse(responseCode = "404", description = "Parent category wasn't found"),
+ @ApiResponse(responseCode = "409",
+ description = "Subcategory already exists / User not permitted to perform the action"),
+ @ApiResponse(responseCode = "500", description = "General Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createComponentSubCategory(
@Parameter(description = "allowed values are resources / products",
@@ -317,13 +318,13 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete component category", method = "DELETE", summary = "Delete component category",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Category.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Category deleted"),
- @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
- @ApiResponse(responseCode = "409", description = "User not permitted to perform the action"),
- @ApiResponse(responseCode = "404", description = "Category not found"),
- @ApiResponse(responseCode = "500", description = "General Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Category.class)))),
+ @ApiResponse(responseCode = "204", description = "Category deleted"),
+ @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
+ @ApiResponse(responseCode = "409", description = "User not permitted to perform the action"),
+ @ApiResponse(responseCode = "404", description = "Category not found"),
+ @ApiResponse(responseCode = "500", description = "General Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteComponentSubCategory(@PathParam(value = "categoryUniqueId") final String categoryUniqueId,
@PathParam(value = "subCategoryUniqueId") final String subCategoryUniqueId,
@@ -354,14 +355,14 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create new component grouping", method = "POST",
- summary = "Create new component grouping for existing sub-category")
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Grouping created"),
- @ApiResponse(responseCode = "400", description = "Invalid grouping data"),
- @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
- @ApiResponse(responseCode = "404", description = "Parent category or subcategory were not found"),
- @ApiResponse(responseCode = "409",
- description = "Grouping already exists / User not permitted to perform the action"),
- @ApiResponse(responseCode = "500", description = "General Error")})
+ summary = "Create new component grouping for existing sub-category",
+ responses = {@ApiResponse(responseCode = "201", description = "Grouping created"),
+ @ApiResponse(responseCode = "400", description = "Invalid grouping data"),
+ @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
+ @ApiResponse(responseCode = "404", description = "Parent category or subcategory were not found"),
+ @ApiResponse(responseCode = "409",
+ description = "Grouping already exists / User not permitted to perform the action"),
+ @ApiResponse(responseCode = "500", description = "General Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response createComponentGrouping(
@Parameter(description = "allowed values are products",
@@ -396,13 +397,13 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Delete component category", method = "DELETE", summary = "Delete component category",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Category.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Category deleted"),
- @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
- @ApiResponse(responseCode = "409", description = "User not permitted to perform the action"),
- @ApiResponse(responseCode = "404", description = "Category not found"),
- @ApiResponse(responseCode = "500", description = "General Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Category.class)))),
+ @ApiResponse(responseCode = "204", description = "Category deleted"),
+ @ApiResponse(responseCode = "403", description = "USER_ID header is missing"),
+ @ApiResponse(responseCode = "409", description = "User not permitted to perform the action"),
+ @ApiResponse(responseCode = "404", description = "Category not found"),
+ @ApiResponse(responseCode = "500", description = "General Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteComponentGrouping(
@PathParam(value = "categoryUniqueId") final String grandParentCategoryUniqueId,
@@ -433,9 +434,9 @@ public class ElementServlet extends BeGenericServlet {
@Path("/tags")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Retrieve all tags", method = "GET", summary = "Retrieve all tags",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns tags Ok"),
+ @Operation(description = "Retrieve all tags", method = "GET", summary = "Retrieve all tags", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns tags Ok"),
@ApiResponse(responseCode = "404", description = "No tags were found"),
@ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -467,11 +468,11 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve all propertyScopes", method = "GET", summary = "Retrieve all propertyScopes",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns propertyScopes Ok"),
- @ApiResponse(responseCode = "404", description = "No propertyScopes were found"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns propertyScopes Ok"),
+ @ApiResponse(responseCode = "404", description = "No propertyScopes were found"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getPropertyScopes(@Context final HttpServletRequest request,
@HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -501,11 +502,11 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve all artifactTypes", method = "GET", summary = "Retrieve all artifactTypes",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns artifactTypes Ok"),
- @ApiResponse(responseCode = "404", description = "No artifactTypes were found"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns artifactTypes Ok"),
+ @ApiResponse(responseCode = "404", description = "No artifactTypes were found"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getArtifactTypes(@Context final HttpServletRequest request,
@HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -541,10 +542,9 @@ public class ElementServlet extends BeGenericServlet {
@Path("/followed")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Retrieve all followed", method = "GET", summary = "Retrieve all followed",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns followed Ok"),
+ @Operation(description = "Retrieve all followed", method = "GET", summary = "Retrieve all followed", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns followed Ok"),
@ApiResponse(responseCode = "404", description = "No followed were found"),
@ApiResponse(responseCode = "404", description = "User not found"),
@ApiResponse(responseCode = "500", description = "Internal Server Error")})
@@ -580,9 +580,9 @@ public class ElementServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve catalog resources and services", method = "GET",
- summary = "Retrieve catalog resources and services", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns resources and services Ok"),
+ summary = "Retrieve catalog resources and services", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns resources and services Ok"),
@ApiResponse(responseCode = "404", description = "No resources and services were found"),
@ApiResponse(responseCode = "404", description = "User not found"),
@ApiResponse(responseCode = "500", description = "Internal Server Error")})
@@ -659,9 +659,10 @@ public class ElementServlet extends BeGenericServlet {
@Path("/ecompPortalMenu")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Retrieve ecomp portal menu - MOC", method = "GET", summary = "Retrieve ecomp portal menu", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Retrieve ecomp portal menu") })
+ @Operation(description = "Retrieve ecomp portal menu - MOC", method = "GET", summary = "Retrieve ecomp portal menu",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Retrieve ecomp portal menu")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getListOfCsars(@Context final HttpServletRequest request) {
return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK),
@@ -672,9 +673,10 @@ public class ElementServlet extends BeGenericServlet {
@Path("/catalogUpdateTime")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Retrieve previus and current catalog update time", method = "GET", summary = "Retrieve previus and current catalog update time", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Retrieve previus and current catalog update time")})
+ @Operation(description = "Retrieve previus and current catalog update time", method = "GET",
+ summary = "Retrieve previus and current catalog update time", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Retrieve previus and current catalog update time")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getCatalogUpdateTime(@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -693,11 +695,14 @@ public class ElementServlet extends BeGenericServlet {
@Path("/setup/ui")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Retrieve all artifactTypes, ui configuration and sdc version", method = "GET", summary = "Retrieve all artifactTypes, ui configuration and sdc version", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns artifactTypes, ui configuration and sdc version Ok"),
- @ApiResponse(responseCode = "404", description = "No artifactTypes were found/no ui configuration were found/no sdc version were found"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ @Operation(description = "Retrieve all artifactTypes, ui configuration and sdc version", method = "GET",
+ summary = "Retrieve all artifactTypes, ui configuration and sdc version", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200",
+ description = "Returns artifactTypes, ui configuration and sdc version Ok"),
+ @ApiResponse(responseCode = "404",
+ description = "No artifactTypes were found/no ui configuration were found/no sdc version were found"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getConfCategoriesAndVersion(@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
String url = request.getMethod() + " " + request.getRequestURI();
@@ -775,6 +780,5 @@ public class ElementServlet extends BeGenericServlet {
return configuration;
}
-
-
}
+
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpoint.java
index 0a87cddd97..7603d499c5 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpoint.java
@@ -23,10 +23,14 @@ package org.openecomp.sdc.be.servlets;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jcabi.aspects.Loggable;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.common.log.wrappers.Logger;
@@ -41,7 +45,8 @@ import javax.ws.rs.core.Response;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@Api(value = "ExceptionHandling Endpoint")
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Produces(MediaType.APPLICATION_JSON)
@Controller
public class ExceptionHandlerEndpoint {
@@ -55,8 +60,9 @@ public class ExceptionHandlerEndpoint {
@GET
@Path("/handleException")
- @ApiOperation(value = "Handle exception", httpMethod = "GET", response = Response.class)
- @ApiResponses(value = {@ApiResponse(code = 500, message = "Internal Error")})
+ @Operation(description = "Handle exception", method = "GET", responses = {
+ @ApiResponse(responseCode = "500", description = "Internal Error",
+ content = @Content(schema = @Schema(implementation = Response.class)))})
public Response sendError() {
log.debug("Request is received");
@@ -65,5 +71,4 @@ public class ExceptionHandlerEndpoint {
.entity(gson.toJson(responseFormat.getRequestError()))
.build();
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java
index 045b5065eb..be106a1ff7 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.onap.sdc.gab.model.GABQuery;
import org.onap.sdc.gab.model.GABQuery.GABQueryType;
@@ -60,7 +61,8 @@ import java.util.stream.Collectors;
@Path("/v1/catalog/gab")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Generic Artifact Browser"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class GenericArtifactBrowserServlet extends BeGenericServlet {
@@ -80,11 +82,11 @@ public class GenericArtifactBrowserServlet extends BeGenericServlet {
@POST
@Path("/searchFor")
- @Operation(description = "Search json paths inside the yaml", method = "POST", summary = "Returns found entries of json paths",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Returned yaml entries"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Search json paths inside the yaml", method = "POST",
+ summary = "Returns found entries of json paths", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Returned yaml entries"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
public Response searchFor(
@Parameter(description = "Generic Artifact search model", required = true) GenericArtifactQueryInfo query,
@Context final HttpServletRequest request) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupEndpoint.java
index dd56b47286..a820125d18 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupEndpoint.java
@@ -21,15 +21,27 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
+import java.util.List;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import org.openecomp.sdc.be.components.impl.GroupBusinessLogicNew;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -44,24 +56,13 @@ import org.openecomp.sdc.common.log.enums.LoggerSupportabilityActions;
import org.openecomp.sdc.common.log.enums.StatusCode;
import org.springframework.stereotype.Controller;
-import javax.inject.Inject;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import java.util.List;
-
/**
* Here new APIs for group will be written in an attempt to gradually clean BL code
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Group Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -80,11 +81,11 @@ public class GroupEndpoint extends BeGenericServlet{
@POST
@Path("/{containerComponentType}/{componentId}/groups/{groupUniqueId}/members")
@Operation(description = "Update group members ", method = "POST",
- summary = "Updates list of members and returns it", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Group members updated"), @ApiResponse(
- responseCode = "400",
- description = "field name invalid type/length, characters; mandatory field is absent, already exists (name)"),
+ summary = "Updates list of members and returns it", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "200", description = "Group members updated"),
+ @ApiResponse(responseCode = "400",
+ description = "field name invalid type/length, characters; mandatory field is absent, already exists (name)"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found"),
@ApiResponse(responseCode = "500", description = "Internal Error")})
@@ -102,9 +103,9 @@ public class GroupEndpoint extends BeGenericServlet{
@GET
@Path("/{containerComponentType}/{componentId}/groups/{groupUniqueId}/properties")
@Operation(description = "Get List of properties on a group", method = "GET",
- summary = "Returns list of properties", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupProperty.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Group Updated"),
+ summary = "Returns list of properties", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupProperty.class)))),
+ @ApiResponse(responseCode = "200", description = "Group Updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -118,9 +119,9 @@ public class GroupEndpoint extends BeGenericServlet{
@PUT
@Path("/{containerComponentType}/{componentId}/groups/{groupUniqueId}/properties")
@Operation(description = "Updates List of properties on a group (only values)", method = "PUT",
- summary = "Returns updated list of properties", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupProperty.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Group Updated"),
+ summary = "Returns updated list of properties", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupProperty.class)))),
+ @ApiResponse(responseCode = "200", description = "Group Updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -132,5 +133,4 @@ public class GroupEndpoint extends BeGenericServlet{
ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.findByParamName(containerComponentType);
return groupBusinessLogic.updateProperties(componentId, componentTypeEnum, userId, groupUniqueId, properties);
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java
index 3eaf9376c8..811b748ca5 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java
@@ -22,15 +22,31 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
+import java.io.IOException;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -51,22 +67,6 @@ import org.openecomp.sdc.common.log.wrappers.Logger;
import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.stereotype.Controller;
-import javax.inject.Inject;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-
/**
* Root resource (exposed at "/" path)
*/
@@ -74,7 +74,8 @@ import java.io.IOException;
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Group Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class GroupServlet extends AbstractValidationsServlet {
@@ -93,10 +94,9 @@ public class GroupServlet extends AbstractValidationsServlet {
@POST
@Path("/{containerComponentType}/{componentId}/groups/{groupType}")
@Operation(description = "Create group ", method = "POST",
- summary = "Creates new group in component and returns it", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Group created"), @ApiResponse(
- responseCode = "400",
+ summary = "Creates new group in component and returns it", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Group created"), @ApiResponse(responseCode = "400",
description = "field name invalid type/length, characters; mandatory field is absent, already exists (name)"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found"),
@@ -119,9 +119,9 @@ public class GroupServlet extends AbstractValidationsServlet {
@GET
@Path("/{containerComponentType}/{componentId}/groups/{groupId}")
@Operation(description = "Get group artifacts ", method = "GET",
- summary = "Returns artifacts metadata according to groupId", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "group found"),
+ summary = "Returns artifacts metadata according to groupId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "group found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Group not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -155,12 +155,11 @@ public class GroupServlet extends AbstractValidationsServlet {
@DELETE
@Path("/{containerComponentType}/{componentId}/groups/{groupUniqueId}")
- @Operation(description = "Delete Group", method = "DELETE", summary = "Returns deleted group id",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "ResourceInstance deleted"), @ApiResponse(
- responseCode = "400",
- description = "field name invalid type/length, characters; mandatory field is absent, already exists (name)"),
+ @Operation(description = "Delete Group", method = "DELETE", summary = "Returns deleted group id", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "ResourceInstance deleted"),
+ @ApiResponse(responseCode = "400",
+ description = "field name invalid type/length, characters; mandatory field is absent, already exists (name)"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found"),
@ApiResponse(responseCode = "500", description = "Internal Error")})
@@ -179,10 +178,9 @@ public class GroupServlet extends AbstractValidationsServlet {
@PUT
@Path("/{containerComponentType}/{componentId}/groups/{groupId}")
- @Operation(description = "Update Group metadata", method = "PUT", summary = "Returns updated Group",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Group updated"),
+ @Operation(description = "Update Group metadata", method = "PUT", summary = "Returns updated Group", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Group updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "component / group Not found")})
@@ -202,11 +200,11 @@ public class GroupServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Group Metadata", method = "PUT", summary = "Returns updated group definition",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Group Updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = GroupDefinition.class)))),
+ @ApiResponse(responseCode = "200", description = "Group Updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateGroupMetadata(@PathParam("containerComponentType") final String containerComponentType,
@PathParam("componentId") final String componentId, @PathParam("groupUniqueId") final String groupUniqueId,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupTypesEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupTypesEndpoint.java
index 7373c58cd7..69c51a62df 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupTypesEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupTypesEndpoint.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.GroupTypeBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -52,7 +53,8 @@ import java.util.List;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "group types resource"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -68,11 +70,10 @@ public class GroupTypesEndpoint extends BeGenericServlet{
@GET
@Path("/groupTypes")
- @Operation(description = "Get group types ", method = "GET", summary = "Returns group types",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = GroupTypeDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "group types found"), @ApiResponse(
- responseCode = "400",
+ @Operation(description = "Get group types ", method = "GET", summary = "Returns group types", responses = {
+ @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = GroupTypeDefinition.class)))),
+ @ApiResponse(responseCode = "200", description = "group types found"), @ApiResponse(responseCode = "400",
description = "field name invalid type/length, characters; mandatory field is absent, already exists (name)"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "500", description = "Internal Error")})
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
index bc5cd8e6f0..bff8436fa4 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java
@@ -24,15 +24,16 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.DataTypeBusinessLogic;
@@ -85,7 +86,8 @@ import java.util.Arrays;
import java.util.List;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
-@OpenAPIDefinition(info = @Info(title = "Input Catalog", description = "Input Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Path("/v1/catalog")
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@@ -114,11 +116,11 @@ public class InputsServlet extends AbstractValidationsServlet {
@POST
@Path("/{containerComponentType}/{componentId}/update/inputs")
@Operation(description = "Update resource inputs", method = "POST", summary = "Returns updated input",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Input updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Input updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
public Response updateComponentInputs(@Parameter(description = "valid values: resources / services",
schema = @Schema(allowableValues = {ComponentTypeEnum.RESOURCE_PARAM_NAME ,
ComponentTypeEnum.SERVICE_PARAM_NAME})) @PathParam("containerComponentType") final String containerComponentType,
@@ -175,10 +177,9 @@ public class InputsServlet extends AbstractValidationsServlet {
@GET
@Path("/{componentType}/{componentId}/componentInstances/{instanceId}/{originComponentUid}/inputs")
- @Operation(description = "Get Inputs only", method = "GET", summary = "Returns Inputs list",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Get Inputs only", method = "GET", summary = "Returns Inputs list", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
public Response getComponentInstanceInputs(@PathParam("componentType") final String componentType,
@@ -209,10 +210,9 @@ public class InputsServlet extends AbstractValidationsServlet {
@GET
@Path("/{componentType}/{componentId}/componentInstances/{instanceId}/{inputId}/properties")
- @Operation(description = "Get properties", method = "GET", summary = "Returns properties list",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))) )
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Get properties", method = "GET", summary = "Returns properties list", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
public Response getInputPropertiesForComponentInstance(@PathParam("componentType") final String componentType,
@@ -244,9 +244,9 @@ public class InputsServlet extends AbstractValidationsServlet {
@GET
@Path("/{componentType}/{componentId}/inputs/{inputId}/inputs")
- @Operation(description = "Get inputs", method = "GET", summary = "Returns inputs list", responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))) )
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Get inputs", method = "GET", summary = "Returns inputs list", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
public Response getInputsForComponentInput(@PathParam("componentType") final String componentType,
@@ -277,9 +277,9 @@ public class InputsServlet extends AbstractValidationsServlet {
@GET
@Path("/{componentType}/{componentId}/inputs/{inputId}")
- @Operation(description = "Get inputs", method = "GET", summary = "Returns inputs list", responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))) )
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Get inputs", method = "GET", summary = "Returns inputs list", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
public Response getInputsAndPropertiesForComponentInput(@PathParam("componentType") final String componentType,
@@ -319,10 +319,9 @@ public class InputsServlet extends AbstractValidationsServlet {
@POST
@Path("/{componentType}/{componentId}/create/inputs")
- @Operation(description = "Create inputs on service", method = "POST", summary = "Return inputs list",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Create inputs on service", method = "POST", summary = "Return inputs list", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
public Response createMultipleInputs(@PathParam("componentType") final String componentType,
@@ -351,10 +350,9 @@ public class InputsServlet extends AbstractValidationsServlet {
*/
@POST
@Path("/{componentType}/{componentId}/create/listInput")
- @Operation(description = "Create a list input on service", method = "POST", summary = "Return input",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))) )
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
+ @Operation(description = "Create a list input on service", method = "POST", summary = "Return input", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Component not found")})
public Response createListInput(@PathParam("componentType") final String componentType,
@@ -412,11 +410,11 @@ public class InputsServlet extends AbstractValidationsServlet {
@DELETE
@Path("/{componentType}/{componentId}/delete/{inputId}/input")
@Operation(description = "Delete input from service", method = "DELETE", summary = "Delete service input",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))) )
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Input deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Input not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Input deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Input not found")})
public Response deleteInput(@PathParam("componentType") final String componentType,
@PathParam("componentId") final String componentId, @PathParam("inputId") final String inputId,
@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId,
@@ -449,12 +447,11 @@ public class InputsServlet extends AbstractValidationsServlet {
@GET
@Path("/{componentType}/{componentId}/dataType/{dataTypeName}")
@Operation(description = "Get data type in service", method = "GET", summary = "Get data type in service",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = DataTypeDefinition.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Data type found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Data type not found")})
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = DataTypeDefinition.class)))),
+ @ApiResponse(responseCode = "200", description = "Data type found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Data type not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getDataType(
@PathParam("componentType") final String componentType,
@@ -492,12 +489,11 @@ public class InputsServlet extends AbstractValidationsServlet {
@GET
@Path("/{componentType}/{componentId}/dataTypes")
@Operation(description = "Get data types that service has", method = "GET", summary = "Get data types in service",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))) )
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Data type found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Component not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Data type found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getDataTypes(
@PathParam("componentType") final String componentType,
@@ -537,12 +533,11 @@ public class InputsServlet extends AbstractValidationsServlet {
@DELETE
@Path("/{componentType}/{componentId}/dataType/{dataTypeName}")
@Operation(description = "Delete data type from service", method = "DELETE", summary = "Delete service input",
- responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Data type deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Data type not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Data type deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Data type not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteDataType(
@PathParam("componentType") final String componentType,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InterfaceOperationServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InterfaceOperationServlet.java
index ff31f54b99..0f7664b4fe 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InterfaceOperationServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InterfaceOperationServlet.java
@@ -19,15 +19,16 @@ package org.openecomp.sdc.be.servlets;
import com.google.common.collect.ImmutableMap;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.InterfaceOperationBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -74,7 +75,8 @@ import java.util.Map;
@Path("/v1/catalog")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Interface Operation Servlet", description = "Interface Operation Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class InterfaceOperationServlet extends AbstractValidationsServlet {
@@ -96,9 +98,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/interfaceOperations")
@Operation(description = "Create Interface Operations on Resource", method = "POST",
- summary = "Create Interface Operations on Resource",responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Interface Operations on Resource"),
+ summary = "Create Interface Operations on Resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Interface Operations on Resource"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Resource not found"),
@@ -165,9 +167,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/interfaceOperations")
@Operation(description = "Update Interface Operations on Resource", method = "PUT",
- summary = "Update Interface Operations on Resource",responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Update Interface Operations on Resource"),
+ summary = "Update Interface Operations on Resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Update Interface Operations on Resource"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Resource not found")})
@@ -184,9 +186,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/interfaces/{interfaceId}/operations/{operationId}")
@Operation(description = "Delete Interface Operation from Resource", method = "DELETE",
- summary = "Delete Interface Operation from Resource", responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete Interface Operation from Resource"),
+ summary = "Delete Interface Operation from Resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete Interface Operation from Resource"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Resource not found")})
@@ -231,9 +233,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/interfaces/{interfaceId}/operations/{operationId}")
@Operation(description = "Get Interface Operation from Resource", method = "GET",
- summary = "GET Interface Operation from Resource",responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete Interface Operation from Resource"),
+ summary = "GET Interface Operation from Resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete Interface Operation from Resource"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Resource not found")})
@@ -277,9 +279,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/interfaceOperations")
@Operation(description = "Create Interface Operations on Service", method = "POST",
- summary = "Create Interface Operations on Service", responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Interface Operations on Service"),
+ summary = "Create Interface Operations on Service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Interface Operations on Service"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found"),
@@ -297,9 +299,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/interfaceOperations")
@Operation(description = "Update Interface Operations on Service", method = "PUT",
- summary = "Update Interface Operations on Service",responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Update Interface Operations on Service"),
+ summary = "Update Interface Operations on Service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Update Interface Operations on Service"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found")})
@@ -316,9 +318,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/interfaces/{interfaceId}/operations/{operationId}")
@Operation(description = "Delete Interface Operation from Service", method = "DELETE",
- summary = "Delete Interface Operation from Service",responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete Interface Operation from Service"),
+ summary = "Delete Interface Operation from Service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete Interface Operation from Service"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found")})
@@ -336,9 +338,9 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/interfaces/{interfaceId}/operations/{operationId}")
@Operation(description = "Get Interface Operation from Service", method = "GET",
- summary = "GET Interface Operation from Service",responses = @ApiResponse(content = @Content(
- array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Get Interface Operation from Service"),
+ summary = "GET Interface Operation from Service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = InterfaceDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Get Interface Operation from Service"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found")})
@@ -350,6 +352,5 @@ public class InterfaceOperationServlet extends AbstractValidationsServlet {
@HeaderParam(value = Constants.USER_ID_HEADER) String userId, @Context final HttpServletRequest request) {
return get(interfaceId, operationId, serviceId, request, userId);
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java
index cb883f20fe..f13621ff10 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java
@@ -23,15 +23,16 @@ package org.openecomp.sdc.be.servlets;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic;
@@ -71,7 +72,8 @@ import java.io.IOException;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Lifecycle Actions Servlet", description = "Lifecycle Actions Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class LifecycleServlet extends BeGenericServlet {
@@ -92,9 +94,9 @@ public class LifecycleServlet extends BeGenericServlet {
@Path("/{componentCollection}/{componentId}/lifecycleState/{lifecycleOperation}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Change Resource lifecycle State", method = "POST", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource state changed"),
+ @Operation(description = "Change Resource lifecycle State", method = "POST", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource state changed"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "409", description = "Resource already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyServlet.java
index cb91473940..141d4cb492 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyServlet.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.PolicyBusinessLogic;
@@ -81,7 +82,8 @@ import java.util.stream.Collectors;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Policy Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -106,10 +108,9 @@ public class PolicyServlet extends AbstractValidationsServlet {
@POST
@Path("/{containerComponentType}/{componentId}/policies/{policyTypeName}")
- @Operation(description = "Create Policy", method = "POST", summary = "Returns created Policy",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Policy created"),
+ @Operation(description = "Create Policy", method = "POST", summary = "Returns created Policy", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Policy created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Policy already exist"),
@@ -133,10 +134,9 @@ public class PolicyServlet extends AbstractValidationsServlet {
@PUT
@Path("/{containerComponentType}/{componentId}/policies/{policyId}")
- @Operation(description = "Update Policy metadata", method = "PUT", summary = "Returns updated Policy",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Policy updated"),
+ @Operation(description = "Update Policy metadata", method = "PUT", summary = "Returns updated Policy", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Policy updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "component / policy Not found")})
@@ -163,9 +163,9 @@ public class PolicyServlet extends AbstractValidationsServlet {
@GET
@Path("/{containerComponentType}/{componentId}/policies/{policyId}")
- @Operation(description = "Get Policy", method = "GET", summary = "Returns Policy", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Policy was found"),
+ @Operation(description = "Get Policy", method = "GET", summary = "Returns Policy", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Policy was found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "component / policy Not found")})
@@ -187,9 +187,9 @@ public class PolicyServlet extends AbstractValidationsServlet {
@DELETE
@Path("/{containerComponentType}/{componentId}/policies/{policyId}")
- @Operation(description = "Delete Policy", method = "DELETE", summary = "No body", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Policy was deleted"),
+ @Operation(description = "Delete Policy", method = "DELETE", summary = "No body", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "204", description = "Policy was deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "component / policy Not found")})
@@ -211,9 +211,9 @@ public class PolicyServlet extends AbstractValidationsServlet {
@PUT
@Path("/{containerComponentType}/{componentId}/policies/{policyId}/undeclare")
- @Operation(description = "undeclare Policy", method = "PUT", summary = "No body",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Policy was undeclared"),
+ @Operation(description = "undeclare Policy", method = "PUT", summary = "No body", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "204", description = "Policy was undeclared"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "component / policy Not found")})
@@ -246,11 +246,10 @@ public class PolicyServlet extends AbstractValidationsServlet {
@GET
@Path("/{containerComponentType}/{componentId}/policies/{policyId}/properties")
@Operation(description = "Get component policy properties", method = "GET",
- summary = "Returns component policy properties",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = PropertyDataDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Properties found"),
- @ApiResponse(responseCode = "400",
- description = "invalid content - Error: containerComponentType is invalid"),
+ summary = "Returns component policy properties", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = PropertyDataDefinition.class)))),
+ @ApiResponse(responseCode = "200", description = "Properties found"), @ApiResponse(responseCode = "400",
+ description = "invalid content - Error: containerComponentType is invalid"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Componentorpolicy not found"),
@ApiResponse(responseCode = "500", description = "The GET request failed due to internal SDC problem.")})
@@ -274,12 +273,12 @@ public class PolicyServlet extends AbstractValidationsServlet {
@PUT
@Path("/{containerComponentType}/{componentId}/policies/{policyId}/properties")
@Operation(description = "Update Policy properties", method = "PUT", summary = "Returns updated Policy",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Policy properties updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "component / policy Not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Policy properties updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "component / policy Not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updatePolicyProperties(@PathParam("componentId") final String containerComponentId, @Parameter(
description = "valid values: resources / services",
@@ -313,10 +312,9 @@ public class PolicyServlet extends AbstractValidationsServlet {
@Path("/{containerComponentType}/{componentId}/policies/{policyId}/targets")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "update policy targets", method = "POST", summary = "Returns updated Policy",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Policy target updated"),
+ @Operation(description = "update policy targets", method = "POST", summary = "Returns updated Policy", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Policy target updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -337,11 +335,11 @@ public class PolicyServlet extends AbstractValidationsServlet {
@POST
@Path("/{componentType}/{componentId}/create/policies")
@Operation(description = "Create policies on service", method = "POST", summary = "Return policies list",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Component found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Component not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Component found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Component not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response declareProperties(@PathParam("componentType") final String componentType,
@PathParam("componentId") final String componentId, @Context final HttpServletRequest request,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpoint.java
index baf246e67a..6c7bf2178c 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpoint.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.PolicyTypeBusinessLogic;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -53,7 +54,8 @@ import java.util.List;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "policy types resource"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@@ -71,11 +73,12 @@ public class PolicyTypesEndpoint extends BeGenericServlet{
@GET
@Path("/policyTypes")
- @Operation(description = "Get policy types ", method = "GET", summary = "Returns policy types",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = PolicyTypeDefinition.class)))))
- @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "policy types found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "500", description = "The GET request failed due to internal SDC problem.")})
+ @Operation(description = "Get policy types ", method = "GET", summary = "Returns policy types", responses = {
+ @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = PolicyTypeDefinition.class)))),
+ @ApiResponse(responseCode = "200", description = "policy types found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "500", description = "The GET request failed due to internal SDC problem.")})
@ResponseView(mixin = {PolicyTypeMixin.class})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public List<PolicyTypeDefinition> getPolicyTypes(@Parameter(description = "An optional parameter to indicate the type of the container from where this call is executed")
@@ -84,5 +87,4 @@ public class PolicyTypesEndpoint extends BeGenericServlet{
log.debug("(get) Start handle request of GET policyTypes");
return policyTypeBusinessLogic.getAllPolicyTypes(userId, internalComponentType);
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementServlet.java
index 27cd082839..2d2b21e4ac 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementServlet.java
@@ -18,15 +18,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.RequirementBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -68,7 +69,8 @@ import java.util.Optional;
@Path("/v1/catalog")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Requirement Servlet", description = "Requirement Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class RequirementServlet extends AbstractValidationsServlet {
private static final Logger LOGGER = Logger.getLogger(RequirementServlet.class);
@@ -76,10 +78,10 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Inject
public RequirementServlet(UserBusinessLogic userBusinessLogic,
- ComponentInstanceBusinessLogic componentInstanceBL,
- ComponentsUtils componentsUtils, ServletUtils servletUtils,
- ResourceImportManager resourceImportManager,
- RequirementBusinessLogic requirementBusinessLogic) {
+ ComponentInstanceBusinessLogic componentInstanceBL,
+ ComponentsUtils componentsUtils, ServletUtils servletUtils,
+ ResourceImportManager resourceImportManager,
+ RequirementBusinessLogic requirementBusinessLogic) {
super(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, resourceImportManager);
this.requirementBusinessLogic = requirementBusinessLogic;
}
@@ -89,9 +91,9 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/requirements")
@Operation(description = "Create requirements on resource", method = "POST",
- summary = "Create requirements on resource",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create requirements"),
+ summary = "Create requirements on resource", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Create requirements"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "requirement already exist")})
@@ -111,9 +113,9 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/requirements")
@Operation(description = "Update Requirements on resource", method = "PUT",
- summary = "Update Requirements on resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Update Requirements"),
+ summary = "Update Requirements on resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Update Requirements"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -130,12 +132,12 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/requirements/{requirementId}")
- @Operation(description = "Get Requirement from resource", method = "GET",
- summary = "GET Requirement from resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "GET requirement"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Get Requirement from resource", method = "GET", summary = "GET Requirement from resource",
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "GET requirement"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getRequirementsFromResource(
@Parameter(description = "Resource Id") @PathParam("resourceId") String resourceId,
@@ -151,9 +153,9 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/resources/{resourceId}/requirements/{requirementId}")
@Operation(description = "Delete requirements from resource", method = "DELETE",
- summary = "Delete requirements from resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete requirement"),
+ summary = "Delete requirements from resource", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete requirement"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -170,9 +172,9 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/requirements")
@Operation(description = "Create requirements on service", method = "POST",
- summary = "Create requirements on service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Requirements"),
+ summary = "Create requirements on service", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Requirements"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Requirement already exist")})
@@ -192,9 +194,9 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/requirements")
@Operation(description = "Update requirements on service", method = "PUT",
- summary = "Update requirements on service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Update requirements"),
+ summary = "Update requirements on service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Update requirements"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -211,12 +213,12 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/requirements/{requirementId}")
- @Operation(description = "Get requirement from service", method = "GET",
- summary = "GET requirement from service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "GET Requirements"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ @Operation(description = "Get requirement from service", method = "GET", summary = "GET requirement from service",
+ responses = {@ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "GET Requirements"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getRequirementsOnService(
@Parameter(description = "Service Id") @PathParam("serviceId") String serviceId,
@@ -233,9 +235,9 @@ public class RequirementServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/services/{serviceId}/requirements/{requirementId}")
@Operation(description = "Delete requirement from service", method = "DELETE",
- summary = "Delete requirement from service", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete Requirements"),
+ summary = "Delete requirement from service", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = RequirementDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete Requirements"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
index 303b0104e9..3a28206823 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
@@ -69,7 +70,8 @@ import java.io.FileNotFoundException;
*/
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog/upload")
-@OpenAPIDefinition(info = @Info(title = "Resources Catalog Upload", description = "Upload resource yaml"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ResourceUploadServlet extends AbstractValidationsServlet {
@@ -128,12 +130,12 @@ public class ResourceUploadServlet extends AbstractValidationsServlet {
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Resource from yaml", method = "POST", summary = "Returns created resource",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Resource already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Resource already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response uploadMultipart(
@Parameter(description = "validValues: normative-resource / user-resource",
@@ -186,5 +188,4 @@ public class ResourceUploadServlet extends AbstractValidationsServlet {
throw e;
}
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java
index 6ecc8d69e7..3a341f127b 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.http.HttpStatus;
import org.json.JSONException;
import org.json.JSONObject;
@@ -86,7 +87,8 @@ import java.util.Map;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Resources Catalog", description = "Resources Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ResourcesServlet extends AbstractValidationsServlet {
@@ -110,10 +112,9 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Path("/resources")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Create Resource", method = "POST", summary = "Returns created resource",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource created"),
+ @Operation(description = "Create Resource", method = "POST", summary = "Returns created resource", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Resource already exist")})
@@ -251,12 +252,13 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@DELETE
@Path("/resources/{resourceName}/{version}")
- @Operation(description = "Delete Resource By Name And Version", method = "DELETE", summary = "Returns no content", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Resource deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Resource not found") })
+ @Operation(description = "Delete Resource By Name And Version", method = "DELETE", summary = "Returns no content",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "204", description = "Resource deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Resource not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteResourceByNameAndVersion(@PathParam("resourceName") final String resourceName, @PathParam("version") final String version, @Context final HttpServletRequest request) {
@@ -289,11 +291,11 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Resource", method = "GET", summary = "Returns resource according to resourceId",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Resource not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Resource not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getResourceById(@PathParam("resourceId") final String resourceId,
@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) throws IOException {
@@ -335,9 +337,9 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Resource by name and version", method = "GET",
- summary = "Returns resource according to resourceId", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource found"),
+ summary = "Returns resource according to resourceId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Resource not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -371,9 +373,9 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "validate resource name", method = "GET",
- summary = "checks if the chosen resource name is available ", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource found"),
+ summary = "checks if the chosen resource name is available ", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource found"),
@ApiResponse(responseCode = "403", description = "Restricted operation")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response validateResourceName(@PathParam("resourceName") final String resourceName,
@@ -453,11 +455,11 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Resource Metadata", method = "PUT", summary = "Returns updated resource metadata",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource metadata updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource metadata updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateResourceMetadata(@PathParam("resourceId") final String resourceId,
@Parameter(description = "Resource metadata to be updated", required = true) String data,
@@ -493,10 +495,9 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Path("/resources/{resourceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Update Resource", method = "PUT", summary = "Returns updated resource",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Resource updated"),
+ @Operation(description = "Update Resource", method = "PUT", summary = "Returns updated resource", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "200", description = "Resource updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Resource already exist")})
@@ -548,11 +549,11 @@ public class ResourcesServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Create Resource", method = "POST", summary = "Returns resource created from csar uuid",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Resource retrieced"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "201", description = "Resource retrieced"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getResourceFromCsar(@Context final HttpServletRequest request,
@HeaderParam(value = Constants.USER_ID_HEADER) String userId,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java
index a8d1eb64c4..4f2f18ef63 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceConsumptionServlet.java
@@ -20,14 +20,15 @@ import com.google.gson.Gson;
import com.google.gson.JsonParseException;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.StringUtils;
import org.json.simple.JSONArray;
import org.json.simple.parser.JSONParser;
@@ -79,7 +80,8 @@ import static org.openecomp.sdc.be.tosca.InterfacesOperationsConverter.SELF;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Service Consumption Servlet", description = "Service Consumption Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Singleton
public class ServiceConsumptionServlet extends BeGenericServlet {
@@ -101,9 +103,9 @@ public class ServiceConsumptionServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@io.swagger.v3.oas.annotations.Operation(description = "Service consumption on operation", method = "POST",
- summary = "Returns consumption data", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service property created"),
+ summary = "Returns consumption data", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Service property created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Service property already exist")})
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceFilterServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceFilterServlet.java
index 41082a3ea8..a37ab0120f 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceFilterServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceFilterServlet.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.codehaus.jackson.map.ObjectMapper;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -78,7 +79,8 @@ import java.util.stream.Collectors;
@Path("/v1/catalog/services/{serviceId}/resourceInstances/{resourceInstanceId}/nodeFilter")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Service Filter", description = "Service Filter Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Singleton
public class ServiceFilterServlet extends AbstractValidationsServlet {
@@ -106,10 +108,10 @@ public class ServiceFilterServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
- @Operation(description = "Add Service Filter Constraint", method = "POST", summary = "Add Service Filter Constraint",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Service Filter"),
+ @Operation(description = "Add Service Filter Constraint", method = "POST",
+ summary = "Add Service Filter Constraint", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Service Filter"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -173,9 +175,9 @@ public class ServiceFilterServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
@Operation(description = "Update Service Filter Constraint", method = "PUT",
- summary = "Update Service Filter Constraint", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Create Service Filter"),
+ summary = "Update Service Filter Constraint", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Service Filter"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -244,9 +246,9 @@ public class ServiceFilterServlet extends AbstractValidationsServlet {
@Produces(MediaType.APPLICATION_JSON)
@Path("/{constraintIndex}")
@Operation(description = "Delete Service Filter Constraint", method = "Delete",
- summary = "Delete Service Filter Constraint", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Delete Service Filter Constraint"),
+ summary = "Delete Service Filter Constraint", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete Service Filter Constraint"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceForwardingPathServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceForwardingPathServlet.java
index 36fd756191..253acd5395 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceForwardingPathServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceForwardingPathServlet.java
@@ -24,15 +24,16 @@ package org.openecomp.sdc.be.servlets;
import com.google.common.collect.Sets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.collections.MapUtils;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceImportManager;
@@ -79,7 +80,8 @@ import java.util.Set;
@Path("/v1/catalog/services/{serviceId}/paths")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Service Forwarding Path", description = "Service Forwarding Path Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ServiceForwardingPathServlet extends AbstractValidationsServlet {
@@ -102,10 +104,10 @@ public class ServiceForwardingPathServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
- @Operation(description = "Create Forwarding Path", method = "POST", summary = "Create Forwarding Path",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value =
- {@ApiResponse(responseCode = "201", description = "Create Forwarding Path"),
+ @Operation(description = "Create Forwarding Path", method = "POST", summary = "Create Forwarding Path",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "201", description = "Create Forwarding Path"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Forwarding Path already exist")})
@@ -124,13 +126,12 @@ public class ServiceForwardingPathServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
- @Operation(description = "Update Forwarding Path", method = "PUT", summary = "Update Forwarding Path",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value =
- {@ApiResponse(responseCode = "201", description = "Update Forwarding Path"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Forwarding Path already exist")})
+ @Operation(description = "Update Forwarding Path", method = "PUT", summary = "Update Forwarding Path", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "201", description = "Update Forwarding Path"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Forwarding Path already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateForwardingPath(
@Parameter(description = "Update Path to create", required = true) String data,
@@ -182,13 +183,13 @@ public class ServiceForwardingPathServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{forwardingPathId}")
- @Operation(description = "Get Forwarding Path", method = "GET", summary = "GET Forwarding Path",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = ForwardingPathDataDefinition.class)))))
- @ApiResponses(value =
- {@ApiResponse(responseCode = "201", description = "Get Forwarding Path"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Forwarding Path already exist")})
+ @Operation(description = "Get Forwarding Path", method = "GET", summary = "GET Forwarding Path", responses = {
+ @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ForwardingPathDataDefinition.class)))),
+ @ApiResponse(responseCode = "201", description = "Get Forwarding Path"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Forwarding Path already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getForwardingPath(
@Parameter(description = "Forwarding Path to create", required = true) String datax,
@@ -230,10 +231,10 @@ public class ServiceForwardingPathServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{forwardingPathId}")
- @Operation(description = "Delete Forwarding Path", method = "DELETE", summary = "Delete Forwarding Path",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value =
- {@ApiResponse(responseCode = "201", description = "Delete Forwarding Path"),
+ @Operation(description = "Delete Forwarding Path", method = "DELETE", summary = "Delete Forwarding Path",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "201", description = "Delete Forwarding Path"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Forwarding Path already exist")})
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java
index eb015791ac..5292f6e9f2 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java
@@ -25,14 +25,16 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.reflect.TypeToken;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.http.HttpStatus;
import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic;
@@ -86,7 +88,8 @@ import java.util.Map;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@Api(value = "Service Catalog", description = "Service Servlet")
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class ServiceServlet extends AbstractValidationsServlet {
@@ -113,10 +116,9 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Path("/services")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Create Service", method = "POST", summary = "Returns created service",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Service created"),
+ @Operation(description = "Create Service", method = "POST", summary = "Returns created service", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "201", description = "Service created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Service already exist")})
@@ -159,9 +161,9 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "validate service name", method = "GET",
- summary = "checks if the chosen service name is available ", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
+ summary = "checks if the chosen service name is available ", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
@ApiResponse(responseCode = "403", description = "Restricted operation")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response validateServiceName(@PathParam("serviceName") final String serviceName,
@@ -196,9 +198,9 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "get component audit records", method = "GET",
- summary = "get audit records for a service or a resource", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
+ summary = "get audit records for a service or a resource", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
@ApiResponse(responseCode = "403", description = "Restricted operation")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getComponentAuditRecords(@PathParam("componentType") final String componentType,
@@ -270,12 +272,12 @@ public class ServiceServlet extends AbstractValidationsServlet {
@DELETE
@Path("/services/{serviceId}")
- @Operation(description = "Delete Service", method = "DELETE", summary = "Return no content", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Service deleted"),
+ @Operation(description = "Delete Service", method = "DELETE", summary = "Return no content", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "204", description = "Service deleted"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Service not found") })
+ @ApiResponse(responseCode = "404", description = "Service not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteService(@PathParam("serviceId") final String serviceId, @Context final HttpServletRequest request) {
ServletContext context = request.getSession().getServletContext();
@@ -311,12 +313,13 @@ public class ServiceServlet extends AbstractValidationsServlet {
@DELETE
@Path("/services/{serviceName}/{version}")
- @Operation(description = "Delete Service By Name And Version", method = "DELETE", summary = "Returns no content", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))))
- @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Service deleted"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Service not found") })
+ @Operation(description = "Delete Service By Name And Version", method = "DELETE", summary = "Returns no content",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Resource.class)))),
+ @ApiResponse(responseCode = "204", description = "Service deleted"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Service not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response deleteServiceByNameAndVersion(@PathParam("serviceName") final String serviceName,
@PathParam("version") final String version,
@@ -355,11 +358,11 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Service Metadata", method = "PUT", summary = "Returns updated service",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service Updated"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "200", description = "Service Updated"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response updateServiceMetadata(@PathParam("serviceId") final String serviceId,
@Parameter(description = "Service object to be Updated", required = true) String data,
@@ -418,9 +421,9 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Update Group Instance Property Values", method = "PUT",
- summary = "Returns updated group instance", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Group Instance Property Values Updated"),
+ summary = "Returns updated group instance", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "200", description = "Group Instance Property Values Updated"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -474,11 +477,11 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Service", method = "GET", summary = "Returns service according to serviceId",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "404", description = "Service not found")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "404", description = "Service not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getServiceById(@PathParam("serviceId") final String serviceId,
@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) throws IOException {
@@ -520,9 +523,9 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Service", method = "GET",
- summary = "Returns service according to name and version", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
+ summary = "Returns service according to name and version", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -560,12 +563,11 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Path("/services/{serviceId}/distribution/{env}/activate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Activate distribution", method = "POST", summary = "activate distribution")
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
- @ApiResponse(responseCode = "409",
+ @Operation(description = "Activate distribution", method = "POST", summary = "activate distribution",
+ responses = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "409",
description = "Service cannot be distributed due to missing deployment artifacts"),
- @ApiResponse(responseCode = "404", description = "Requested service was not found"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error. Please try again later.")})
+ @ApiResponse(responseCode = "404", description = "Requested service was not found"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error. Please try again later.")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response activateDistribution(@PathParam("serviceId") final String serviceId,
@PathParam("env") final String env, @Context final HttpServletRequest request,
@@ -603,13 +605,13 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Mark distribution as deployed", method = "POST",
- summary = "relevant audit record will be created")
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service was marked as deployed"),
- @ApiResponse(responseCode = "409", description = "Restricted operation"),
- @ApiResponse(responseCode = "403", description = "Service is not available"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Requested service was not found"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error. Please try again later.")})
+ summary = "relevant audit record will be created",
+ responses = {@ApiResponse(responseCode = "200", description = "Service was marked as deployed"),
+ @ApiResponse(responseCode = "409", description = "Restricted operation"),
+ @ApiResponse(responseCode = "403", description = "Service is not available"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Requested service was not found"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error. Please try again later.")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response markDistributionAsDeployed(@PathParam("serviceId") final String serviceId,
@PathParam("did") final String did, @Context final HttpServletRequest request,
@@ -645,7 +647,8 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Path("/services/{serviceId}/tempUrlToBeDeleted")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "500", description = "Internal Server Error. Please try again later.") })
+ @Operation(responses = {@ApiResponse(responseCode = "200", description = "OK"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error. Please try again later.")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response tempUrlToBeDeleted(@PathParam("serviceId") final String serviceId, @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -679,9 +682,9 @@ public class ServiceServlet extends AbstractValidationsServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Retrieve Service component relations map", method = "GET",
- summary = "Returns service components relations",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = ServiceRelations.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Service found"),
+ summary = "Returns service components relations", responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = ServiceRelations.class)))),
+ @ApiResponse(responseCode = "200", description = "Service found"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "404", description = "Service not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
@@ -720,5 +723,4 @@ public class ServiceServlet extends AbstractValidationsServlet {
throw e;
}
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
index 3af822836d..526e0230bb 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
@@ -22,14 +22,15 @@ package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.collections4.ListUtils;
import org.openecomp.sdc.be.components.impl.CapabilitiesBusinessLogic;
import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
@@ -80,7 +81,8 @@ import java.util.stream.Collectors;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@OpenAPIDefinition(info = @Info(title = "Types Fetch Servlet",description = "Types Fetch Servlet"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class TypesFetchServlet extends AbstractValidationsServlet {
@@ -114,9 +116,9 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
@Path("dataTypes")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get data types", method = "GET", summary = "Returns data types", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "datatypes"),
+ @Operation(description = "Get data types", method = "GET", summary = "Returns data types", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "datatypes"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "Data types not found")})
@@ -146,14 +148,13 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
@Path("interfaceLifecycleTypes")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get interface lifecycle types", method = "GET", summary = "Returns interface lifecycle types", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "Interface lifecycle types"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Interface lifecycle types not found")
- })
+ @Operation(description = "Get interface lifecycle types", method = "GET",
+ summary = "Returns interface lifecycle types", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "Interface lifecycle types"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Interface lifecycle types not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getInterfaceLifecycleTypes(@Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
@@ -195,9 +196,9 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
@Path("capabilityTypes")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get capability types", method = "GET", summary = "Returns capability types", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "capabilityTypes"),
+ @Operation(description = "Get capability types", method = "GET", summary = "Returns capability types", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "capabilityTypes"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "Capability types not found")})
@@ -248,12 +249,13 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
@Path("relationshipTypes")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get relationship types", method = "GET", summary = "Returns relationship types", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "relationshipTypes"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "404", description = "Relationship types not found")})
+ @Operation(description = "Get relationship types", method = "GET", summary = "Returns relationship types",
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "relationshipTypes"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "404", description = "Relationship types not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getAllRelationshipTypesServlet(@Context final HttpServletRequest request, @HeaderParam(value =
Constants.USER_ID_HEADER) String userId) {
@@ -301,10 +303,11 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
@Path("nodeTypes")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "Get node types", method = "GET", summary = "Returns node types", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "nodeTypes"), @ApiResponse(responseCode = "403", description =
- "Restricted operation"), @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @Operation(description = "Get node types", method = "GET", summary = "Returns node types", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "200", description = "nodeTypes"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "404", description = "Node types not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getAllNodeTypesServlet(@Context final HttpServletRequest request, @HeaderParam(value =
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadEndpoint.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadEndpoint.java
index 98d64dfc47..b0b897daf3 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadEndpoint.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadEndpoint.java
@@ -22,15 +22,16 @@ package org.openecomp.sdc.be.servlets;
import com.google.common.annotations.VisibleForTesting;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.openecomp.sdc.be.components.impl.CommonImportManager;
@@ -67,7 +68,8 @@ import java.util.Map;
@Path("/v1/catalog/uploadType")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Catalog Types Upload"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class TypesUploadEndpoint extends BeGenericServlet{
private static final Logger LOGGER = LoggerFactory.getLogger(TypesUploadEndpoint.class);
@@ -87,9 +89,9 @@ public class TypesUploadEndpoint extends BeGenericServlet{
@POST
@Path("/annotationtypes")
@Operation(description = "Create AnnotationTypes from yaml", method = "POST",
- summary = "Returns created annotation types",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "annotation types created"),
+ summary = "Returns created annotation types", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "annotation types created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "annotation types already exist")})
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java
index ed0e27b87c..953346ee36 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java
@@ -23,15 +23,16 @@ package org.openecomp.sdc.be.servlets;
import com.google.gson.reflect.TypeToken;
import com.jcabi.aspects.Loggable;
import fj.data.Either;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.openecomp.sdc.be.components.impl.CapabilityTypeImportManager;
@@ -87,7 +88,8 @@ import java.util.stream.Collectors;
@Path("/v1/catalog/uploadType")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
-@OpenAPIDefinition(info = @Info(title = "Catalog Types Upload"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class TypesUploadServlet extends AbstractValidationsServlet {
private static final Logger log = Logger.getLogger(TypesUploadServlet.class);
@@ -126,9 +128,9 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/capability")
@Operation(description = "Create Capability Type from yaml", method = "POST",
- summary = "Returns created Capability Type", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Capability Type created"),
+ summary = "Returns created Capability Type", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Capability Type created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Capability Type already exist")})
@@ -145,9 +147,9 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/relationship")
@Operation(description = "Create Relationship Type from yaml", method = "POST",
- summary = "Returns created Relationship Type", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Relationship Type created"),
+ summary = "Returns created Relationship Type", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Relationship Type created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Relationship Type already exist")})
@@ -162,9 +164,9 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/interfaceLifecycle")
@Operation(description = "Create Interface Lyfecycle Type from yaml", method = "POST",
- summary = "Returns created Interface Lifecycle Type", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Interface Lifecycle Type created"),
+ summary = "Returns created Interface Lifecycle Type", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Interface Lifecycle Type created"),
@ApiResponse(responseCode = "403", description = "Restricted operation"),
@ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
@ApiResponse(responseCode = "409", description = "Interface Lifecycle Type already exist")})
@@ -181,12 +183,12 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/categories")
@Operation(description = "Create Categories from yaml", method = "POST", summary = "Returns created categories",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Categories created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Category already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Categories created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Category already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response uploadCategories(@Parameter(description = "FileInputStream") @FormDataParam("categoriesZip") File file,
@Context final HttpServletRequest request, @HeaderParam("USER_ID") String creator) {
@@ -199,12 +201,12 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/datatypes")
@Operation(description = "Create Categories from yaml", method = "POST", summary = "Returns created data types",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Data types created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "Data types already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "Data types created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "Data types already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response uploadDataTypes(@Parameter(description = "FileInputStream") @FormDataParam("dataTypesZip") File file,
@Context final HttpServletRequest request, @HeaderParam("USER_ID") String creator) {
@@ -216,12 +218,12 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/grouptypes")
@Operation(description = "Create GroupTypes from yaml", method = "POST", summary = "Returns created group types",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "group types created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "group types already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "group types created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "group types already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response uploadGroupTypes(
@Parameter(description = "toscaTypeMetadata") @FormDataParam("toscaTypeMetadata") String toscaTypesMetaData,
@@ -235,12 +237,12 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
@POST
@Path("/policytypes")
@Operation(description = "Create PolicyTypes from yaml", method = "POST", summary = "Returns created policy types",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "policy types created"),
- @ApiResponse(responseCode = "403", description = "Restricted operation"),
- @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
- @ApiResponse(responseCode = "409", description = "policy types already exist")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))),
+ @ApiResponse(responseCode = "201", description = "policy types created"),
+ @ApiResponse(responseCode = "403", description = "Restricted operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid content / Missing content"),
+ @ApiResponse(responseCode = "409", description = "policy types already exist")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response uploadPolicyTypes(
@Parameter(description = "toscaTypeMetadata") @FormDataParam("toscaTypeMetadata") String toscaTypesMetaData,
@@ -413,5 +415,4 @@ public class TypesUploadServlet extends AbstractValidationsServlet {
buildStatusForElementTypeCreate(responseWrapper, generateElementTypeFromYml,
ActionStatus.RELATIONSHIP_TYPE_ALREADY_EXIST, NodeTypeEnum.RelationshipType.name());
}
-
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java
index a95c75c87e..1cd9844331 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java
@@ -21,15 +21,16 @@
package org.openecomp.sdc.be.servlets;
import com.jcabi.aspects.Loggable;
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.servers.Server;
+import io.swagger.v3.oas.annotations.servers.Servers;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.tags.Tags;
import org.eclipse.jetty.http.HttpStatus;
import org.openecomp.sdc.be.components.impl.aaf.AafPermission;
import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed;
@@ -61,7 +62,8 @@ import java.util.ArrayList;
import java.util.List;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/user")
-@OpenAPIDefinition(info = @Info(title = "User Administration", description = "User admininstarator operations"))
+@Tags({@Tag(name = "SDC Internal APIs")})
+@Servers({@Server(url = "/sdc2/rest")})
@Controller
public class UserAdminServlet extends BeGenericServlet {
@@ -97,13 +99,15 @@ public class UserAdminServlet extends BeGenericServlet {
@Path("/{userId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
+
@Operation(description = "retrieve user details", method = "GET",
- summary = "Returns user details according to userId",responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns user Ok"),
+ summary = "Returns user details according to userId",responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns user Ok"),
@ApiResponse(responseCode = "404", description = "User not found"),
@ApiResponse(responseCode = "405", description = "Method Not Allowed"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")
+ })
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public User get(
@Parameter(description = "userId of user to get", required = true) @PathParam("userId") final String userId,
@@ -115,10 +119,9 @@ public class UserAdminServlet extends BeGenericServlet {
@Path("/{userId}/role")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "retrieve user role", summary = "Returns user role according to userId",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns user role Ok"),
+ @Operation(description = "retrieve user role", summary = "Returns user role according to userId", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns user role Ok"),
@ApiResponse(responseCode = "404", description = "User not found"),
@ApiResponse(responseCode = "405", description = "Method Not Allowed"),
@ApiResponse(responseCode = "500", description = "Internal Server Error")})
@@ -136,9 +139,9 @@ public class UserAdminServlet extends BeGenericServlet {
@Path("/{userId}/role")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "update user role", summary = "Update user role", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Update user OK"),
+ @Operation(description = "update user role", summary = "Update user role", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Update user OK"),
@ApiResponse(responseCode = "400", description = "Invalid Content."),
@ApiResponse(responseCode = "403", description = "Missing information/Restricted operation"),
@ApiResponse(responseCode = "404", description = "User not found"),
@@ -159,9 +162,9 @@ public class UserAdminServlet extends BeGenericServlet {
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "add user", method = "POST", summary = "Provision new user", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "New user created"),
+ @Operation(description = "add user", method = "POST", summary = "Provision new user", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "201", description = "New user created"),
@ApiResponse(responseCode = "400", description = "Invalid Content."),
@ApiResponse(responseCode = "403", description = "Missing information"),
@ApiResponse(responseCode = "405", description = "Method Not Allowed"),
@@ -183,9 +186,11 @@ public class UserAdminServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "authorize", summary = "authorize user", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Returns user Ok"), @ApiResponse(responseCode = "403", description = "Restricted Access"), @ApiResponse(responseCode = "500", description = "Internal Server Error") })
+ @Operation(description = "authorize", summary = "authorize user", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns user Ok"),
+ @ApiResponse(responseCode = "403", description = "Restricted Access"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public User authorize(@HeaderParam(value = Constants.USER_ID_HEADER) String userId,
@HeaderParam("HTTP_CSP_FIRSTNAME") String firstName,
@@ -210,11 +215,11 @@ public class UserAdminServlet extends BeGenericServlet {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "retrieve all administrators", method = "GET", summary = "Returns all administrators",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns user Ok"),
- @ApiResponse(responseCode = "405", description = "Method Not Allowed"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns user Ok"),
+ @ApiResponse(responseCode = "405", description = "Method Not Allowed"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public List<User> getAdminsUser(@Context final HttpServletRequest request) {
return userBusinessLogic.getAllAdminUsers();
@@ -227,13 +232,13 @@ public class UserAdminServlet extends BeGenericServlet {
@Operation(description = "Retrieve the list of all active ASDC users or only group of users having specific roles.",
method = "GET",
summary = "Returns list of users with the specified roles, or all of users in the case of empty 'roles' header",
- responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns users Ok"),
- @ApiResponse(responseCode = "204", description = "No provisioned ASDC users of requested role"),
- @ApiResponse(responseCode = "403", description = "Restricted Access"),
- @ApiResponse(responseCode = "400", description = "Missing content"),
- @ApiResponse(responseCode = "500", description = "Internal Server Error")})
+ responses = {@ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Returns users Ok"),
+ @ApiResponse(responseCode = "204", description = "No provisioned ASDC users of requested role"),
+ @ApiResponse(responseCode = "403", description = "Restricted Access"),
+ @ApiResponse(responseCode = "400", description = "Missing content"),
+ @ApiResponse(responseCode = "500", description = "Internal Server Error")})
public List<User> getUsersList(@Context final HttpServletRequest request, @Parameter(
description = "Any active user's USER_ID ") @HeaderParam(Constants.USER_ID_HEADER) final String userId,
@Parameter(
@@ -256,9 +261,9 @@ public class UserAdminServlet extends BeGenericServlet {
@Path("/{userId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @Operation(description = "delete user", summary = "Delete user", responses = @ApiResponse(
- content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))))
- @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Update deleted OK"),
+ @Operation(description = "delete user", summary = "Delete user", responses = {
+ @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = User.class)))),
+ @ApiResponse(responseCode = "200", description = "Update deleted OK"),
@ApiResponse(responseCode = "400", description = "Invalid Content."),
@ApiResponse(responseCode = "403", description = "Missing information"),
@ApiResponse(responseCode = "404", description = "User not found"),