Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Commits
827ea853
Commit
827ea853
authored
2 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
Add swagger class for ground motions
parent
bbda354f
No related branches found
No related tags found
2 merge requests
!128
Production Release | nshmp-ws-static
,
!127
Resolves - Handle Multiple NetCDF Files for AASHTO Service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/SwaggerGroundMotions.java
+73
-0
73 additions, 0 deletions
...sgs/earthquake/nshmp/netcdf/www/SwaggerGroundMotions.java
with
73 additions
and
0 deletions
src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/SwaggerGroundMotions.java
0 → 100644
+
73
−
0
View file @
827ea853
package
gov.usgs.earthquake.nshmp.netcdf.www
;
import
io.micronaut.http.HttpRequest
;
/**
* Swagger page updates for ground motion services.
*
* @author U.S. Geological Survey
*/
class
SwaggerGroundMotions
extends
Swagger
<
NetcdfServiceGroundMotions
>
{
SwaggerGroundMotions
(
HttpRequest
<?>
request
,
NetcdfServiceGroundMotions
service
)
{
super
(
request
,
service
);
}
@Override
String
descriptionHeader
()
{
return
String
.
format
(
"AASHTO-%d Data Sets"
,
service
.
netcdfDataFiles
().
aashtoYear
());
}
@Override
String
serviceInfo
()
{
return
String
.
format
(
String
.
join
(
""
,
"Get risk-targeted design response spectra for the %d "
,
"editions of American Association of State Highway and Transportation "
,
"Officials (AASHTO) bridge design specifications."
),
service
.
netcdfDataFiles
().
aashtoYear
());
}
@Override
String
servicePatternSection
()
{
var
url
=
NetcdfWsUtils
.
getRequestUrl
(
request
);
url
=
url
.
endsWith
(
"/swagger"
)
?
url
.
replace
(
"/swagger"
,
""
)
:
url
;
return
new
StringBuilder
()
.
append
(
"<details>\n"
+
"<summary>Service Call Patterns</summary>\n"
)
.
append
(
"### Query Pattern\n"
+
"The query based service call is in the form of:\n"
+
"```text\n"
+
url
+
"/spectra?longitude={number}&latitude={number}\n"
+
url
+
"/spectra?longitude={number}&latitude={number}&siteClass={string}\n"
+
"````\n"
+
"Example:\n"
+
"```text\n"
+
url
+
"/spectra?longitude=-118&latitude=34\n"
+
url
+
"/spectra?longitude=-118&latitude=34&siteClass=BC\n"
+
"```\n"
)
.
append
(
"### Slash Pattern\n"
+
"The slash based service call is in the form of:\n"
+
"```text\n"
+
url
+
"/spectra/{longitude}/{latitude}\n"
+
url
+
"/spectra/{longitude}/{latitude}/{siteClass}\n"
+
"```\n"
+
"Example:\n"
+
"```text\n"
+
url
+
"/spectra/-118/34\n"
+
url
+
"/spectra/-118/34/BC\n"
+
"```\n"
)
.
append
(
"</details>"
)
.
toString
();
}
}
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