Skip to content
Snippets Groups Projects
Commit 9015e68d authored by trantzas's avatar trantzas
Browse files

Adding OAS support for the NFV Metrics API (fix for #12)

parent bf673ad4
No related branches found
No related tags found
2 merge requests!14Merging "develop" to "main" branch,!12Created metrics endpoints for NFV-related information
Pipeline #14238 passed
...@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
@Tag(name = "NFV_MetricsApi") @Tag(name = "NFV Metrics Api")
public interface MetricsApi { public interface MetricsApi {
Logger log = LoggerFactory.getLogger(MetricsApi.class); Logger log = LoggerFactory.getLogger(MetricsApi.class);
......
...@@ -57,7 +57,7 @@ public class SwaggerConfig { ...@@ -57,7 +57,7 @@ public class SwaggerConfig {
SpringDocUtils.getConfig().replaceWithClass(java.time.LocalDate.class, java.sql.Date.class); SpringDocUtils.getConfig().replaceWithClass(java.time.LocalDate.class, java.sql.Date.class);
SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class); SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
return GroupedOpenApi.builder() return GroupedOpenApi.builder()
.group("nfv-portal.api.controller-v1.0.0") .group("nfv-portal.api.controller")
.addOpenApiCustomizer( this.apiInfoPortalAPI() ) .addOpenApiCustomizer( this.apiInfoPortalAPI() )
.packagesToScan("portal.api.controller") .packagesToScan("portal.api.controller")
.build(); .build();
...@@ -69,11 +69,36 @@ public class SwaggerConfig { ...@@ -69,11 +69,36 @@ public class SwaggerConfig {
return openApi -> openApi return openApi -> openApi
.specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth")) .specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth"))
.info(new Info().title("NFV portal API") .info(new Info().title("NFV Portal API")
.description("## NFV portal API") .description("## An API to manage NFV Artifacts")
.version("1.0.0") .version("1.0.0")
.license(new License().name("Apache 2.0").url("http://openslice.io"))); .license(new License().name("Apache 2.0").url("https://osl.etsi.org")));
}
@Bean
public GroupedOpenApi nfvportalmetrics(){
SpringDocUtils.getConfig().replaceWithClass(java.time.LocalDate.class, java.sql.Date.class);
SpringDocUtils.getConfig().replaceWithClass(java.time.OffsetDateTime.class, java.util.Date.class);
return GroupedOpenApi.builder()
.group("nfv-portal.api.metrics")
.addOpenApiCustomizer( this.nfvPortalAPImetrics() )
.packagesToScan("portal.api.metrics")
.build();
}
OpenApiCustomizer nfvPortalAPImetrics() {
return openApi -> openApi
.specVersion( SpecVersion.V30 ).addSecurityItem(new SecurityRequirement().addList("security_auth"))
.info(new Info().title("NFV Portal metrics API")
.description("## An API to retrieve metrics about NFV Portal")
.version("1.0.0")
.license(new License().name("Apache 2.0").url("https://osl.etsi.org")));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment