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
363e3161
Commit
363e3161
authored
3 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
Update swagger doc
parent
5d64666a
No related branches found
No related tags found
2 merge requests
!109
Production Release
,
!107
AASHTO Updates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java
+50
-15
50 additions, 15 deletions
...ov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java
with
50 additions
and
15 deletions
src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java
+
50
−
15
View file @
363e3161
...
...
@@ -9,7 +9,7 @@ import gov.usgs.earthquake.nshmp.netcdf.NetcdfHazardCurves;
import
gov.usgs.earthquake.nshmp.netcdf.www.NetcdfService.RequestDataImt
;
import
gov.usgs.earthquake.nshmp.netcdf.www.NetcdfService.RequestDataSiteClass
;
import
gov.usgs.earthquake.nshmp.netcdf.www.NetcdfService.ResponseData
;
import
gov.usgs.earthquake.nshmp.netcdf.www.NetcdfService
.
ResponseMetadata
;
import
gov.usgs.earthquake.nshmp.netcdf.www.NetcdfService
HazardCurves.Hazard
ResponseMetadata
;
import
gov.usgs.earthquake.nshmp.www.NshmpMicronautServlet
;
import
gov.usgs.earthquake.nshmp.www.ResponseBody
;
...
...
@@ -24,7 +24,6 @@ import io.micronaut.http.annotation.Get;
import
io.micronaut.http.annotation.PathVariable
;
import
io.micronaut.http.annotation.QueryValue
;
import
io.micronaut.runtime.event.annotation.EventListener
;
import
io.swagger.v3.oas.annotations.Hidden
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Content
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
@@ -72,9 +71,15 @@ public class NetcdfController {
@Operation
(
summary
=
"Returns static curves given a longitude, latitude, site class, and IMT"
,
description
=
"### Returns hazard curves for a "
+
"user-specified latitude, longitude, site class, and IMT."
+
"\n"
+
"Enter the latitude and longitude select the site class and IMT, and press `Execute`."
,
"user-specified latitude, longitude, site class, and IMT.\n"
+
"Enter the latitude and longitude select the site class and IMT, and press `Execute`.\n"
+
"### Service call pattern\n"
+
"This service call is slashed delimited with pattern: "
+
"`/hazard/{longitude}/{latitude}/{siteClass}/{imt}`\n"
+
"<br><br>"
+
"Example: `/hazard/-118/34/BC/PGA`"
,
operationId
=
"hazard-by-imt"
)
@ApiResponse
(
description
=
"Spatially interpolated hazard curves"
,
...
...
@@ -102,9 +107,15 @@ public class NetcdfController {
@Operation
(
summary
=
"Returns static curves given a longitude, latitude, and site class."
,
description
=
"### Returns hazard curves for a "
+
"user-specified latitude, longitude, and site class."
+
"\n"
+
"Enter the latitude and longitude select the site class, and press `Execute`."
,
"user-specified latitude, longitude, and site class.\n"
+
"Enter the latitude and longitude select the site class, and press `Execute`.\n"
+
"### Service call pattern\n"
+
"This service call is slashed delimited with pattern: "
+
"`/hazard/{longitude}/{latitude}/{siteClass}`\n"
+
"<br><br>"
+
"Example: `/hazard/-118/34/BC`"
,
operationId
=
"hazard-by-siteclass"
)
@ApiResponse
(
description
=
"Spatially interpolated hazard curves"
,
...
...
@@ -130,9 +141,15 @@ public class NetcdfController {
@Operation
(
summary
=
"Returns static curves given a longitude and latitude"
,
description
=
"### Returns hazard curves for all site class for a "
+
"user-specified latitude and longitude."
+
"\n"
+
"Enter the latitude and longitude and press `Execute`."
,
"user-specified latitude and longitude.\n"
+
"Enter the latitude and longitude and press `Execute`.\n"
+
"### Service call pattern\n"
+
"This service call is slashed delimited with pattern: "
+
"`/hazard/{longitude}/{latitude}`\n"
+
"<br><br>"
+
"Example: `/hazard/-118/34`"
,
operationId
=
"hazard"
)
@ApiResponse
(
description
=
"Returns static curves from the NSHM NetCDF file"
,
...
...
@@ -155,7 +172,25 @@ public class NetcdfController {
* @param latitude Latitude of the site
* @param siteClass The site class (optional)
*/
@Hidden
@Operation
(
summary
=
"Returns static curves given a longitude, latitude, site class, and IMT"
,
description
=
"### Returns hazard curves for a "
+
"user-specified latitude, longitude, site class, and IMT.\n"
+
"Enter the latitude and longitude select the site class (optional) and "
+
"IMT (optional), and press `Execute`.\n"
+
"### Service call pattern\n"
+
"This service call is query based with pattern: "
+
"`/hazard?longitude={number}&latitude={number}&siteClass={string}&imt={string}`\n"
+
"<br><br>"
+
"Example: `/hazard?longitude=-118&latitude=34&siteClass=A&imt=PGA`"
,
operationId
=
"hazard-by-imt"
)
@ApiResponse
(
description
=
"Spatially interpolated hazard curves"
,
responseCode
=
"200"
,
content
=
@Content
(
schema
=
@Schema
(
implementation
=
ResponseByImt
.
class
)))
@Get
(
uri
=
"{?longitude,latitude,siteClass,imt}"
,
produces
=
MediaType
.
APPLICATION_JSON
)
public
HttpResponse
<
String
>
doGet
(
HttpRequest
<?>
request
,
...
...
@@ -170,15 +205,15 @@ public class NetcdfController {
// For Swagger schema
private
static
class
ResponseByImt
extends
ResponseBody
<
RequestDataImt
,
ResponseData
<
ResponseMetadata
>>
{}
ResponseBody
<
RequestDataImt
,
ResponseData
<
Hazard
ResponseMetadata
>>
{}
// For Swagger schema
private
static
class
ResponseBySiteClass
extends
ResponseBody
<
RequestDataSiteClass
,
List
<
ResponseData
<
ResponseMetadata
>>>
{}
ResponseBody
<
RequestDataSiteClass
,
List
<
ResponseData
<
Hazard
ResponseMetadata
>>>
{}
// For Swagger schema
private
static
class
Response
extends
ResponseBody
<
RequestDataSiteClass
,
List
<
List
<
ResponseData
<
ResponseMetadata
>>>>
{}
ResponseBody
<
RequestDataSiteClass
,
List
<
List
<
ResponseData
<
Hazard
ResponseMetadata
>>>>
{}
}
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