Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
org.etsi.osl.portal.api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSL
code
org.etsi.osl.portal.api
Commits
9015e68d
Commit
9015e68d
authored
1 month ago
by
trantzas
Browse files
Options
Downloads
Patches
Plain Diff
Adding OAS support for the NFV Metrics API (fix for
#12
)
parent
bf673ad4
No related branches found
Branches containing commit
No related tags found
2 merge requests
!14
Merging "develop" to "main" branch
,
!12
Created metrics endpoints for NFV-related information
Pipeline
#14238
passed
1 month ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/portal/api/metrics/MetricsApi.java
+1
-1
1 addition, 1 deletion
src/main/java/portal/api/metrics/MetricsApi.java
src/main/java/portal/api/swagger2/SwaggerConfig.java
+29
-4
29 additions, 4 deletions
src/main/java/portal/api/swagger2/SwaggerConfig.java
with
30 additions
and
5 deletions
src/main/java/portal/api/metrics/MetricsApi.java
+
1
−
1
View file @
9015e68d
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/portal/api/swagger2/SwaggerConfig.java
+
29
−
4
View file @
9015e68d
...
@@ -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
p
ortal API"
)
.
info
(
new
Info
().
title
(
"NFV
P
ortal 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"
)));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment