From 7441e7c92d97d056a994a59d41e56b10d50864f4 Mon Sep 17 00:00:00 2001 From: Charles Graham Date: Tue, 19 Mar 2024 10:18:52 -0500 Subject: [PATCH 1/3] Add servers to the swagger docs for use with openapi generators #587 --- cwms-data-api/src/main/webapp/swagger-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cwms-data-api/src/main/webapp/swagger-config.yaml b/cwms-data-api/src/main/webapp/swagger-config.yaml index ce9e50d11..bd3024ce9 100644 --- a/cwms-data-api/src/main/webapp/swagger-config.yaml +++ b/cwms-data-api/src/main/webapp/swagger-config.yaml @@ -8,6 +8,13 @@ info: name: Support url: https://github.com/usace/cwms-data-api host: https://cmws-data.usace.army.mil +servers: + - url: https://cwms-data.usace.army.mil + description: PRIMARY production server + - url: https://water.usace.army.mil, + description: Alias for the PRIMARY production server + - url: https://cwms.sec.usace.army.mil, + description: CWBI Production Server url: /cwms-data/swagger-docs basePath: /cwms-data schemes: From 864168ffed8c5eb75f7864032234aa5cd8ae368f Mon Sep 17 00:00:00 2001 From: Charles Graham Date: Tue, 19 Mar 2024 10:23:11 -0500 Subject: [PATCH 2/3] Removed extra commas --- cwms-data-api/src/main/webapp/swagger-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cwms-data-api/src/main/webapp/swagger-config.yaml b/cwms-data-api/src/main/webapp/swagger-config.yaml index bd3024ce9..77b6bb659 100644 --- a/cwms-data-api/src/main/webapp/swagger-config.yaml +++ b/cwms-data-api/src/main/webapp/swagger-config.yaml @@ -11,9 +11,9 @@ host: https://cmws-data.usace.army.mil servers: - url: https://cwms-data.usace.army.mil description: PRIMARY production server - - url: https://water.usace.army.mil, + - url: https://water.usace.army.mil description: Alias for the PRIMARY production server - - url: https://cwms.sec.usace.army.mil, + - url: https://cwms.sec.usace.army.mil description: CWBI Production Server url: /cwms-data/swagger-docs basePath: /cwms-data From beaf2ebed229939437facb2d65f0077da8fbbb11 Mon Sep 17 00:00:00 2001 From: Charles Graham SWT Date: Wed, 20 Mar 2024 15:14:08 -0500 Subject: [PATCH 3/3] Removed internal CWBI server. --- .../src/main/webapp/swagger-config.yaml | 1458 ++++++++--------- 1 file changed, 728 insertions(+), 730 deletions(-) diff --git a/cwms-data-api/src/main/webapp/swagger-config.yaml b/cwms-data-api/src/main/webapp/swagger-config.yaml index 77b6bb659..01ae3ffec 100644 --- a/cwms-data-api/src/main/webapp/swagger-config.yaml +++ b/cwms-data-api/src/main/webapp/swagger-config.yaml @@ -1,730 +1,728 @@ -swagger: '2.0' -info: - version: '1.0.0' - title: CWMS Data API - description: CWMS Data API is a generalized web service API that allows clients to retrieve data from Corps Water Management System (CWMS) databases. - termsOfService: https://cwms-data.usace.army.mil/cwms-data - contact: - name: Support - url: https://github.com/usace/cwms-data-api -host: https://cmws-data.usace.army.mil -servers: - - url: https://cwms-data.usace.army.mil - description: PRIMARY production server - - url: https://water.usace.army.mil - description: Alias for the PRIMARY production server - - url: https://cwms.sec.usace.army.mil - description: CWBI Production Server -url: /cwms-data/swagger-docs -basePath: /cwms-data -schemes: - - https -consumes: - - application/json -produces: - - application/json - - application/xml - - text/plain - - text/csv -paths: - /locations: - get: - description: Returns CWMS location data - operationId: findLocations - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: name - in: query - description: | - Specifies the name(s) of the location(s) whose data is to be included in the response. The name(s) shall be matched with values in the AV_LOC2.LOCATION_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: pipes - - name: office - in: query - description: | - Specifies the owning office of the location(s) to include in the response. If this field is not specified, matching location information from all offices shall be returned. - required: false - type: string - - name: unit - in: query - description: | - Specifies the elevation unit of the response. - Valid values for the unit field are: - 1. EN. Specifies English unit system. Elevation values will be in feet. - 2. SI. Specifies the SI unit system. Elevation values will be in meters. - 3. Other. Any unit returned in the response to the units URI request that has an abstract parameter of 'Length'. - If this field is not specified, the response shall be the same as if 'EN' were specified. - required: false - type: string - enum: ["EN", "SI", "Other"] - - name: datum - in: query - description: | - Specifies the elevation datum of the response. - Valid values for this field are: - 1. NAVD88. The elevation values will be in the specified or default units above the NAVD-88 datum. - 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. - If this field is not specified, each elevation value will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. - required: false - type: string - enum: [NAVD88, NGVD29] - - name: format - in: query - description: | - Specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. wml2 (only if name field is specified) - 5. json - If this field is not specified, the 'tab' format shall be used. - required: false - type: string - enum: ["tab", "csv", "xml", "wml2", "json"] - responses: - '200': - description: location response - schema: - type: array - items: - $ref: '#/definitions/location' - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /locations/{id}: - get: - description: Returns a location based on a single ID - operationId: findLocationById - produces: - - application/json - - application/xml - - text/xml - - text/html - parameters: - - name: id - in: path - description: ID of location to fetch - required: true - type: integer - format: int64 - responses: - '200': - description: location response - schema: - $ref: '#/definitions/location' - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /timeseries: - get: - description: Returns Cwms time series data - operationId: findTimeseries - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: name - in: query - description: | - Specifies the name(s) of the time series whose data is to be included in the response. The name(s) shall be matched with values in the AV_CWMS_TS_ID2.LOCATION_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: csv - - name: office - in: query - description: | - Specifies the owning office of the time series whose data is to be included in the response. If this field is not specified, matching time series information from all offices shall be returned. - required: false - type: string - - name: unit - in: query - description: | - Specifies the unit or unit system of the response. Valid values for the unit field are: - 1. EN. Specifies English unit system. Time series values will be in the default English units for their parameters. - 2. SI. Specifies the SI unit system. Time series values will be in the default SI units for their parameters. - 3. Other. Any unit returned in the response to the units URI request that is appropriate for the requested parameters. - If this field is not specified, the response shall be the same as if 'EN' were specified. - required: false - type: string - enum: ["EN", "SI", "Other"] - - name: datum - in: query - description: | - Specifies the elevation datum of the response. This field affects only elevation time series. Valid values for this field are: - 1. NAVD88. The elevation values will in the specified or default units above the NAVD-88 datum. - 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. - If this field is not specified, elevation time series will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. - required: false - type: string - enum: ["NAVD88", "NGVD29"] - - name: begin - in: query - description: | - Specifies the start of the time window for data to be included in the response. If this field is not specified, any required time window begins 24 hours prior to the specified or default end time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: end - in: query - description: | - Specifies the end of the time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: timezone - in: query - description: | - Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. - required: false - type: string - - name: size - in: query - description: | - Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. - required: false - type: string - - name: format - in: query - description: | - Specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. wml2 (only if name field is specified) - 5. json - 6. jpg (only if name field is specified) - 7. png (only if name field is specified) - If this field is not specified, the 'tab' format shall be used. - required: false - type: string - enum: ["tab", "csv", "xml", "wml2", "json", "jpg", "png"] - responses: - '200': - description: location response - schema: - type: array - items: - $ref: '#/definitions/location' - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /ratings: - get: - description: The ratings URI allows access to CWMS ratings data - operationId: findRatings - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: name - in: query - description: | - Specifies the name(s) of the ratings whose data is to be included in the response. The name(s) shall be matched with values in the AV_RATING_SPEC.RATING_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: csv - - name: office - in: query - description: | - Specifies the owning office of the rating(s) whose data is to be included in the response. If this field is not specified, matching rating information from all offices shall be returned. - required: false - type: string - - name: unit - in: query - description: | - Specifies the unit or unit system of the response. Valid values for the unit field are: - 1. NATIVE. Specifies native rating units. Rating values will be in the units that the rating was originally defined in. - 2. EN. Specifies English unit system. Rating values will be in the default English units for their parameters. - 3. SI. Specifies the SI unit system. Rating values will be in the default SI units for their parameters. - 4. Other. Each rating has multiple units ' one for each independent parameter and one for the dependent parameter. Therefore, units must be specified in sets for each rating. The format is to separate the independent parameter units from each other using the comma ',' character and to separate the independent parameter unit(s) from the dependent parameter unit using the semicolon ';' character. Each unit in a rating unit set must be in the set of units returned in the response to the units URI request that is appropriate for the requested the corresponding parameter. - If this field is not specified, the response shall be the same as if 'NATIVE' were specified. - required: false - type: string - enum: ["NATIVE", "EN", "SI", "Other"] - - name: datum - in: query - description: | - Specifies the elevation datum of the response. This field affects only elevation rating values. Valid values for this field are: - 1. NAVD88. The elevation values will in the specified or default units above the NAVD-88 datum. - 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. - If this field is not specified, elevation rating values will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. - required: false - type: string - enum: ["NAVD88", "NGVD29"] - - name: begin - in: query - description: | - Specifies the start of the effective date time window for data to be included in the response. If this field is not specified, any required time window begins at the latest rating effective time on or before the (default or specified) end time (i.e., the single rating effective at the end time is returned). If this field is specified as 'none' (case in-sensitive), any required effective date time will have no beginning time (i.e., all ratings with effective dates on or before the end time are returned). The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: end - in: query - description: | - Specifies the end of the effective date time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: timezone - in: query - description: | - Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. - required: false - type: string - - name: size - in: query - description: | - Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. - required: false - type: string - - name: format - in: query - description: | - Specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. json - 5. jpg (only if name field is specified) - 6. png (only if name field is specified) - If this field is not specified, the 'tab' format shall be used. - required: false - type: string - enum: ["tab", "csv", "xml", "json", "jpg", "png"] - responses: - '200': - description: ratings response - schema: - type: string - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /levels: - get: - description: The levels URI allows access to CWMS location level data. The responses to this URI are time series views of the matching location levels for the specified or default time window; location level definitions are not included in the responses. - operationId: findLevels - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: name - in: query - description: | - Specifies the name(s) of the location level(s) whose data is to be included in the response. The name(s) shall be matched with values in the AV_LOCATION_LEVEL2.LOCATION_LEVEL_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: csv - - name: office - in: query - description: | - Specifies the owning office of the location level(s) whose data is to be included in the response. If this field is not specified, matching location level information from all offices shall be returned. - required: false - type: string - - name: unit - in: query - description: | - Specifies the unit or unit system of the response. Valid values for the unit field are: - 1. EN. Specifies English unit system. Location level values will be in the default English units for their parameters. - 2. SI. Specifies the SI unit system. Location level values will be in the default SI units for their parameters. - 3. Other. Any unit returned in the response to the units URI request that is appropriate for the requested parameters. - If this field is not specified, the response shall be the same as if 'EN' were specified. - required: false - type: string - enum: [ "EN", "SI", "Other"] - - name: datum - in: query - description: | - Specifies the elevation datum of the response. This field affects only elevation location levels. Valid values for this field are: - 1. NAVD88. The elevation values will in the specified or default units above the NAVD-88 datum. - 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. - If this field is not specified, elevation location levels will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. - required: false - type: string - enum: ["NAVD88", "NGVD29"] - - name: begin - in: query - description: | - Specifies the start of the time window for data to be included in the response. If this field is not specified, any required time window begins 24 hours prior to the specified or default end time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: end - in: query - description: | - Specifies the end of the time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: timezone - in: query - description: | - Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. - required: false - type: string - - name: size - in: query - description: | - Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. - required: false - type: string - - name: format - in: query - description: | - Specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. wml2 (only if name field is specified) - 5. json - 6. jpg (only if name field is specified) - 7. png (only if name field is specified) - required: false - type: string - enum: ["tab", "csv", "xml", "wml2", "json", "jpg", "png"] - responses: - '200': - description: levels response - schema: - type: string - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - # /offices: - # get: - # description: The offices URI allows access to CWMS office data. - # operationId: findOffices - # produces: - # - application/json - # - application/xml - # - text/xml - # - text/html - # - text/csv - # parameters: - # - name: format - # in: query - # description: | - # Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: - # 1. tab - # 2. csv - # 3. xml - # 4. json - # required: false - # type: string - # enum: ["tab", "csv", "xml", "json"] - # responses: - # '200': - # description: office response - # schema: - # type: string - # default: - # description: unexpected error - # schema: - # $ref: '#/definitions/errorModel' - /timezones: - get: - description: The timezones URI allows access to CWMS time zone data. - operationId: findTimezones - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: format - in: query - description: | - Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. json - required: false - type: string - enum: ["tab", "csv", "xml", "json"] - responses: - '200': - description: timezone response - schema: - type: string - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /parameters: - get: - description: The parameters URI allows access to CWMS base parameter data. - operationId: findParameters - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: format - in: query - description: | - Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. json - required: false - type: string - enum: ["tab", "csv", "xml", "json"] - responses: - '200': - description: parameters response - schema: - type: string - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /units: - get: - description: The units URI allows access to CWMS unit data. - operationId: findUnits - produces: - - application/json - - application/xml - - text/xml - - text/html - - text/csv - parameters: - - name: format - in: query - description: | - Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. tab - 2. csv - 3. xml - 4. json - required: false - type: string - enum: ["tab", "csv", "xml", "json"] - responses: - '200': - description: units response - schema: - type: string - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - /plots: - get: - description: The plots URI allows access to CWMS plotting API. The plotting API will generate plots that include time series, location level time series, and ratings. At least one of 'timeseries', 'level', or 'rating' must be specified. - operationId: findPlots - produces: - - image/jpeg - - image/png - parameters: - - name: timeseries - in: query - description: | - Specifies the name(s) of the time series whose data is to be included in the response. The name(s) shall be matched with values in the AV_CWMS_TS_ID2.LOCATION_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: pipes - - name: level - in: query - description: | - Specifies the name(s) of the location level(s) whose data is to be included in the response. The name(s) shall be matched with values in the AV_LOCATION_LEVEL2.LOCATION_LEVEL_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: pipes - - name: rating - in: query - description: | - Specifies the name(s) of the ratings whose data is to be included in the response. The name(s) shall be matched with values in the AV_RATING_SPEC.RATING_ID view column in a case insensitive manner to determine the locations to include. - required: false - type: array - items: - type: string - collectionFormat: pipes - - name: office - in: query - description: | - Specifies the owning office of the location level(s) whose data is to be included in the response. If this field is not specified, matching plot information from all offices shall be returned. - required: false - type: string - - name: unit - in: query - description: | - Specifies the unit or unit system of the response. - Valid values for the unit field are: - 1. NATIVE. (Only for ratings). Specifies native rating units. Rating values will be in the units that the rating was originally defined in. - 2. EN. Specifies English unit system. Values will be in the default English units for their parameter. - 3. SI. Specifies the SI unit system. Values will be in the default SI units for their parameter. - If this field is not specified, the response shall be the same as if 'NATIVE' were specified for ratings and 'EN' were specified for time series and levels. - required: false - type: string - enum: ["EN", "SI", "Other"] - - name: datum - in: query - description: | - Specifies the elevation datum of the response. This field affects only elevation location levels. Valid values for this field are: - 1. NAVD88. The elevation values will be in the specified or default units above the NAVD-88 datum. - 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. - If this field is not specified, elevation location levels will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. - required: false - type: string - enum: [NAVD88, NGVD29] - - name: begin - in: query - description: | - Specifies the start of the time window for data to be included in the response. If this field is not specified, any required time window begins 24 hours prior to the specified or default end time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: end - in: query - description: | - Specifies the end of the time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. - required: false - type: string - format: dateTime - - name: timezone - in: query - description: | - Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. - required: false - type: string - - name: size - in: query - description: | - Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. - required: false - type: string - - name: format - in: query - description: | - Specifies the encoding format of the response. Valid values for the format field for this URI are: - 1. jpg (only if name field is specified) - 2. png (only if name field is specified) - If this field is not specified, the 'jpg' format shall be used. - required: false - type: string - enum: ["jpg", "png"] - responses: - '200': - description: plots response - schema: - type: string - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' -definitions: - location: - properties: - id: - type: integer - format: int64 - baseLocationId: - type: string - subLocationId: - type: string - locationType: - type: string - elevation: - type: number - format: double - unitId: - type: string - verticalDatum: - type: string - latitude: - type: number - format: double - longitude: - type: number - format: double - horizontalDatum: - type: string - timeZoneName: - type: string - countyName: - type: string - stateInitial: - type: string - publicName: - type: string - longName: - type: string - description: - type: string - baseLocActiveFlag: - type: string - locActiveFlag: - type: string - locationKindId: - type: string - mapLabel: - type: string - publishedLatitude: - type: number - format: double - publishedLongitude: - type: number - format: double - boundingOfficeId: - type: string - nationId: - type: string - nearestCity: - type: string - dbOfficeId: - type: string - locationId: - type: string - unitSystem: - type: string - # private BigDecimal baseLocationCode; - required: - - id - - errorModel: - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string +swagger: '2.0' +info: + version: '1.0.0' + title: CWMS Data API + description: CWMS Data API is a generalized web service API that allows clients to retrieve data from Corps Water Management System (CWMS) databases. + termsOfService: https://cwms-data.usace.army.mil/cwms-data + contact: + name: Support + url: https://github.com/usace/cwms-data-api +host: https://cmws-data.usace.army.mil +servers: + - url: https://cwms-data.usace.army.mil + description: PRIMARY production server + - url: https://water.usace.army.mil + description: Alias for the PRIMARY production server +url: /cwms-data/swagger-docs +basePath: /cwms-data +schemes: + - https +consumes: + - application/json +produces: + - application/json + - application/xml + - text/plain + - text/csv +paths: + /locations: + get: + description: Returns CWMS location data + operationId: findLocations + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: name + in: query + description: | + Specifies the name(s) of the location(s) whose data is to be included in the response. The name(s) shall be matched with values in the AV_LOC2.LOCATION_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: pipes + - name: office + in: query + description: | + Specifies the owning office of the location(s) to include in the response. If this field is not specified, matching location information from all offices shall be returned. + required: false + type: string + - name: unit + in: query + description: | + Specifies the elevation unit of the response. + Valid values for the unit field are: + 1. EN. Specifies English unit system. Elevation values will be in feet. + 2. SI. Specifies the SI unit system. Elevation values will be in meters. + 3. Other. Any unit returned in the response to the units URI request that has an abstract parameter of 'Length'. + If this field is not specified, the response shall be the same as if 'EN' were specified. + required: false + type: string + enum: ["EN", "SI", "Other"] + - name: datum + in: query + description: | + Specifies the elevation datum of the response. + Valid values for this field are: + 1. NAVD88. The elevation values will be in the specified or default units above the NAVD-88 datum. + 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. + If this field is not specified, each elevation value will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. + required: false + type: string + enum: [NAVD88, NGVD29] + - name: format + in: query + description: | + Specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. wml2 (only if name field is specified) + 5. json + If this field is not specified, the 'tab' format shall be used. + required: false + type: string + enum: ["tab", "csv", "xml", "wml2", "json"] + responses: + '200': + description: location response + schema: + type: array + items: + $ref: '#/definitions/location' + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /locations/{id}: + get: + description: Returns a location based on a single ID + operationId: findLocationById + produces: + - application/json + - application/xml + - text/xml + - text/html + parameters: + - name: id + in: path + description: ID of location to fetch + required: true + type: integer + format: int64 + responses: + '200': + description: location response + schema: + $ref: '#/definitions/location' + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /timeseries: + get: + description: Returns Cwms time series data + operationId: findTimeseries + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: name + in: query + description: | + Specifies the name(s) of the time series whose data is to be included in the response. The name(s) shall be matched with values in the AV_CWMS_TS_ID2.LOCATION_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: csv + - name: office + in: query + description: | + Specifies the owning office of the time series whose data is to be included in the response. If this field is not specified, matching time series information from all offices shall be returned. + required: false + type: string + - name: unit + in: query + description: | + Specifies the unit or unit system of the response. Valid values for the unit field are: + 1. EN. Specifies English unit system. Time series values will be in the default English units for their parameters. + 2. SI. Specifies the SI unit system. Time series values will be in the default SI units for their parameters. + 3. Other. Any unit returned in the response to the units URI request that is appropriate for the requested parameters. + If this field is not specified, the response shall be the same as if 'EN' were specified. + required: false + type: string + enum: ["EN", "SI", "Other"] + - name: datum + in: query + description: | + Specifies the elevation datum of the response. This field affects only elevation time series. Valid values for this field are: + 1. NAVD88. The elevation values will in the specified or default units above the NAVD-88 datum. + 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. + If this field is not specified, elevation time series will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. + required: false + type: string + enum: ["NAVD88", "NGVD29"] + - name: begin + in: query + description: | + Specifies the start of the time window for data to be included in the response. If this field is not specified, any required time window begins 24 hours prior to the specified or default end time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: end + in: query + description: | + Specifies the end of the time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: timezone + in: query + description: | + Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. + required: false + type: string + - name: size + in: query + description: | + Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. + required: false + type: string + - name: format + in: query + description: | + Specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. wml2 (only if name field is specified) + 5. json + 6. jpg (only if name field is specified) + 7. png (only if name field is specified) + If this field is not specified, the 'tab' format shall be used. + required: false + type: string + enum: ["tab", "csv", "xml", "wml2", "json", "jpg", "png"] + responses: + '200': + description: location response + schema: + type: array + items: + $ref: '#/definitions/location' + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /ratings: + get: + description: The ratings URI allows access to CWMS ratings data + operationId: findRatings + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: name + in: query + description: | + Specifies the name(s) of the ratings whose data is to be included in the response. The name(s) shall be matched with values in the AV_RATING_SPEC.RATING_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: csv + - name: office + in: query + description: | + Specifies the owning office of the rating(s) whose data is to be included in the response. If this field is not specified, matching rating information from all offices shall be returned. + required: false + type: string + - name: unit + in: query + description: | + Specifies the unit or unit system of the response. Valid values for the unit field are: + 1. NATIVE. Specifies native rating units. Rating values will be in the units that the rating was originally defined in. + 2. EN. Specifies English unit system. Rating values will be in the default English units for their parameters. + 3. SI. Specifies the SI unit system. Rating values will be in the default SI units for their parameters. + 4. Other. Each rating has multiple units ' one for each independent parameter and one for the dependent parameter. Therefore, units must be specified in sets for each rating. The format is to separate the independent parameter units from each other using the comma ',' character and to separate the independent parameter unit(s) from the dependent parameter unit using the semicolon ';' character. Each unit in a rating unit set must be in the set of units returned in the response to the units URI request that is appropriate for the requested the corresponding parameter. + If this field is not specified, the response shall be the same as if 'NATIVE' were specified. + required: false + type: string + enum: ["NATIVE", "EN", "SI", "Other"] + - name: datum + in: query + description: | + Specifies the elevation datum of the response. This field affects only elevation rating values. Valid values for this field are: + 1. NAVD88. The elevation values will in the specified or default units above the NAVD-88 datum. + 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. + If this field is not specified, elevation rating values will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. + required: false + type: string + enum: ["NAVD88", "NGVD29"] + - name: begin + in: query + description: | + Specifies the start of the effective date time window for data to be included in the response. If this field is not specified, any required time window begins at the latest rating effective time on or before the (default or specified) end time (i.e., the single rating effective at the end time is returned). If this field is specified as 'none' (case in-sensitive), any required effective date time will have no beginning time (i.e., all ratings with effective dates on or before the end time are returned). The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: end + in: query + description: | + Specifies the end of the effective date time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: timezone + in: query + description: | + Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. + required: false + type: string + - name: size + in: query + description: | + Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. + required: false + type: string + - name: format + in: query + description: | + Specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. json + 5. jpg (only if name field is specified) + 6. png (only if name field is specified) + If this field is not specified, the 'tab' format shall be used. + required: false + type: string + enum: ["tab", "csv", "xml", "json", "jpg", "png"] + responses: + '200': + description: ratings response + schema: + type: string + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /levels: + get: + description: The levels URI allows access to CWMS location level data. The responses to this URI are time series views of the matching location levels for the specified or default time window; location level definitions are not included in the responses. + operationId: findLevels + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: name + in: query + description: | + Specifies the name(s) of the location level(s) whose data is to be included in the response. The name(s) shall be matched with values in the AV_LOCATION_LEVEL2.LOCATION_LEVEL_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: csv + - name: office + in: query + description: | + Specifies the owning office of the location level(s) whose data is to be included in the response. If this field is not specified, matching location level information from all offices shall be returned. + required: false + type: string + - name: unit + in: query + description: | + Specifies the unit or unit system of the response. Valid values for the unit field are: + 1. EN. Specifies English unit system. Location level values will be in the default English units for their parameters. + 2. SI. Specifies the SI unit system. Location level values will be in the default SI units for their parameters. + 3. Other. Any unit returned in the response to the units URI request that is appropriate for the requested parameters. + If this field is not specified, the response shall be the same as if 'EN' were specified. + required: false + type: string + enum: [ "EN", "SI", "Other"] + - name: datum + in: query + description: | + Specifies the elevation datum of the response. This field affects only elevation location levels. Valid values for this field are: + 1. NAVD88. The elevation values will in the specified or default units above the NAVD-88 datum. + 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. + If this field is not specified, elevation location levels will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. + required: false + type: string + enum: ["NAVD88", "NGVD29"] + - name: begin + in: query + description: | + Specifies the start of the time window for data to be included in the response. If this field is not specified, any required time window begins 24 hours prior to the specified or default end time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: end + in: query + description: | + Specifies the end of the time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: timezone + in: query + description: | + Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. + required: false + type: string + - name: size + in: query + description: | + Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. + required: false + type: string + - name: format + in: query + description: | + Specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. wml2 (only if name field is specified) + 5. json + 6. jpg (only if name field is specified) + 7. png (only if name field is specified) + required: false + type: string + enum: ["tab", "csv", "xml", "wml2", "json", "jpg", "png"] + responses: + '200': + description: levels response + schema: + type: string + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + # /offices: + # get: + # description: The offices URI allows access to CWMS office data. + # operationId: findOffices + # produces: + # - application/json + # - application/xml + # - text/xml + # - text/html + # - text/csv + # parameters: + # - name: format + # in: query + # description: | + # Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: + # 1. tab + # 2. csv + # 3. xml + # 4. json + # required: false + # type: string + # enum: ["tab", "csv", "xml", "json"] + # responses: + # '200': + # description: office response + # schema: + # type: string + # default: + # description: unexpected error + # schema: + # $ref: '#/definitions/errorModel' + /timezones: + get: + description: The timezones URI allows access to CWMS time zone data. + operationId: findTimezones + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: format + in: query + description: | + Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. json + required: false + type: string + enum: ["tab", "csv", "xml", "json"] + responses: + '200': + description: timezone response + schema: + type: string + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /parameters: + get: + description: The parameters URI allows access to CWMS base parameter data. + operationId: findParameters + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: format + in: query + description: | + Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. json + required: false + type: string + enum: ["tab", "csv", "xml", "json"] + responses: + '200': + description: parameters response + schema: + type: string + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /units: + get: + description: The units URI allows access to CWMS unit data. + operationId: findUnits + produces: + - application/json + - application/xml + - text/xml + - text/html + - text/csv + parameters: + - name: format + in: query + description: | + Specifies specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. tab + 2. csv + 3. xml + 4. json + required: false + type: string + enum: ["tab", "csv", "xml", "json"] + responses: + '200': + description: units response + schema: + type: string + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' + /plots: + get: + description: The plots URI allows access to CWMS plotting API. The plotting API will generate plots that include time series, location level time series, and ratings. At least one of 'timeseries', 'level', or 'rating' must be specified. + operationId: findPlots + produces: + - image/jpeg + - image/png + parameters: + - name: timeseries + in: query + description: | + Specifies the name(s) of the time series whose data is to be included in the response. The name(s) shall be matched with values in the AV_CWMS_TS_ID2.LOCATION_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: pipes + - name: level + in: query + description: | + Specifies the name(s) of the location level(s) whose data is to be included in the response. The name(s) shall be matched with values in the AV_LOCATION_LEVEL2.LOCATION_LEVEL_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: pipes + - name: rating + in: query + description: | + Specifies the name(s) of the ratings whose data is to be included in the response. The name(s) shall be matched with values in the AV_RATING_SPEC.RATING_ID view column in a case insensitive manner to determine the locations to include. + required: false + type: array + items: + type: string + collectionFormat: pipes + - name: office + in: query + description: | + Specifies the owning office of the location level(s) whose data is to be included in the response. If this field is not specified, matching plot information from all offices shall be returned. + required: false + type: string + - name: unit + in: query + description: | + Specifies the unit or unit system of the response. + Valid values for the unit field are: + 1. NATIVE. (Only for ratings). Specifies native rating units. Rating values will be in the units that the rating was originally defined in. + 2. EN. Specifies English unit system. Values will be in the default English units for their parameter. + 3. SI. Specifies the SI unit system. Values will be in the default SI units for their parameter. + If this field is not specified, the response shall be the same as if 'NATIVE' were specified for ratings and 'EN' were specified for time series and levels. + required: false + type: string + enum: ["EN", "SI", "Other"] + - name: datum + in: query + description: | + Specifies the elevation datum of the response. This field affects only elevation location levels. Valid values for this field are: + 1. NAVD88. The elevation values will be in the specified or default units above the NAVD-88 datum. + 2. NGVD29. The elevation values will be in the specified or default units above the NGVD-29 datum. + If this field is not specified, elevation location levels will be in the specified or default units above that location's native vertical datum in the database, which is identified in the response. + required: false + type: string + enum: [NAVD88, NGVD29] + - name: begin + in: query + description: | + Specifies the start of the time window for data to be included in the response. If this field is not specified, any required time window begins 24 hours prior to the specified or default end time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: end + in: query + description: | + Specifies the end of the time window for data to be included in the response. If this field is not specified, any required time window ends at the current time. The format for this field is ISO 8601 extended, i.e., 'YYYY-MM-DDThh:mm:ss'. + required: false + type: string + format: dateTime + - name: timezone + in: query + description: | + Specifies the time zone of the values of the begin and end fields (unless otherwise specified), as well as the time zone of any times in the response. If this field is not specified, the default time zone of UTC shall be used. + required: false + type: string + - name: size + in: query + description: | + Specifies the size of the image in pixels if the value of the format field is 'jpg' or 'img'. If this field is not specified, the default size of '600x500' (width x height) shall be used for any generated images. + required: false + type: string + - name: format + in: query + description: | + Specifies the encoding format of the response. Valid values for the format field for this URI are: + 1. jpg (only if name field is specified) + 2. png (only if name field is specified) + If this field is not specified, the 'jpg' format shall be used. + required: false + type: string + enum: ["jpg", "png"] + responses: + '200': + description: plots response + schema: + type: string + default: + description: unexpected error + schema: + $ref: '#/definitions/errorModel' +definitions: + location: + properties: + id: + type: integer + format: int64 + baseLocationId: + type: string + subLocationId: + type: string + locationType: + type: string + elevation: + type: number + format: double + unitId: + type: string + verticalDatum: + type: string + latitude: + type: number + format: double + longitude: + type: number + format: double + horizontalDatum: + type: string + timeZoneName: + type: string + countyName: + type: string + stateInitial: + type: string + publicName: + type: string + longName: + type: string + description: + type: string + baseLocActiveFlag: + type: string + locActiveFlag: + type: string + locationKindId: + type: string + mapLabel: + type: string + publishedLatitude: + type: number + format: double + publishedLongitude: + type: number + format: double + boundingOfficeId: + type: string + nationId: + type: string + nearestCity: + type: string + dbOfficeId: + type: string + locationId: + type: string + unitSystem: + type: string + # private BigDecimal baseLocationCode; + required: + - id + + errorModel: + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string