722 строки
23 KiB
JSON
722 строки
23 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "DPIRD Radar - West Australia",
|
|
"description": "Allows you to integrate the DPIRD RADAR estimated rainfall data within your applications",
|
|
"version": "1.0",
|
|
"contact": {
|
|
"name": "Paul Culmsee",
|
|
"url": "https://www.sevensigma.com.au",
|
|
"email": "paul.culmsee@sevensigma.com.au"
|
|
}
|
|
},
|
|
"host": "api.dpird.wa.gov.au",
|
|
"basePath": "/v2/radar",
|
|
"schemes": [
|
|
"https"
|
|
],
|
|
"consumes": [],
|
|
"produces": [],
|
|
"paths": {
|
|
"/radars": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "default",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"$ref": "#/definitions/apiMetaDataModel"
|
|
},
|
|
"collection": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/radarMetadataModel"
|
|
},
|
|
"description": "collection"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "Get Radars",
|
|
"description": "Returns a list of radars and their metadata.",
|
|
"operationId": "GetRadars",
|
|
"parameters": [{
|
|
"$ref": "#/parameters/radarCodesInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/offsetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/limitInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/sortInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/radarSelectFieldsInQuery"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/radars/{radarCode}": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "default",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"$ref": "#/definitions/apiMetaDataModel"
|
|
},
|
|
"collection": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/radarMetadataModel"
|
|
},
|
|
"description": "collection"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "Get Radar",
|
|
"operationId": "GetRadar",
|
|
"description": "Get metadata for a specific radar",
|
|
"parameters": [{
|
|
"$ref": "#/parameters/radarCodeInPathLookup"
|
|
}, {
|
|
"$ref": "#/parameters/radarSelectFieldsInQuery"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/nearby": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "default",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"$ref": "#/definitions/apiMetaDataModel"
|
|
},
|
|
"collection": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/radarLocationModel"
|
|
},
|
|
"description": "Information about a radar point."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "Get Nearby Radar",
|
|
"description": "Get nearest radar points to a latitude and longitude",
|
|
"operationId": "GetNearbyRadar",
|
|
"parameters": [{
|
|
"$ref": "#/parameters/latitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/longitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/dataSetInQuery"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/rainfall": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "default",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"$ref": "#/definitions/apiMetaDataModel"
|
|
},
|
|
"data": {
|
|
"$ref": "#/definitions/rainfallModel"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "Get Radar Rainfall",
|
|
"description": "Get the rainfall for specific radars",
|
|
"operationId": "GetRadarRainfall",
|
|
"parameters": [{
|
|
"$ref": "#/parameters/latitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/longitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/radarCodeInQueryLookup"
|
|
}, {
|
|
"$ref": "#/parameters/dataSetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/rainfallSelectFieldsInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/offsetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/limitInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/sortInQuery"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/summaries/daily": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "default",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"$ref": "#/definitions/apiMetaDataModel"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"radar": {
|
|
"$ref": "#/definitions/radarLocationModel2"
|
|
},
|
|
"summaries": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/rainfallSummaryModel"
|
|
},
|
|
"description": "summaries"
|
|
}
|
|
},
|
|
"description": "data"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "Get Radar Daily Summaries",
|
|
"description": "Get the daily summaries for a latitude and longitude based on the closest radar point",
|
|
"operationId": "GetRadarDailySummaries",
|
|
"parameters": [{
|
|
"$ref": "#/parameters/startDateInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/endDateInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/latitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/longitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/dataSetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/summarySelectFieldsInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/offsetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/limitInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/sortInQuery"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/summaries/monthly": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "default",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"metadata": {
|
|
"$ref": "#/definitions/apiMetaDataModel"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"radar": {
|
|
"$ref": "#/definitions/radarLocationModel2"
|
|
},
|
|
"summaries": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/rainfallSummaryModel"
|
|
},
|
|
"description": "summaries"
|
|
}
|
|
},
|
|
"description": "data"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"summary": "Get Radar Monthly Summaries",
|
|
"description": "Get the monthly summaries for a latitude and longitude based on the closest radar point",
|
|
"operationId": "GetRadarMonthlySummaries",
|
|
"parameters": [{
|
|
"$ref": "#/parameters/startMonthInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/endMonthInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/latitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/longitudeInQueryRequired"
|
|
}, {
|
|
"$ref": "#/parameters/dataSetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/summarySelectFieldsInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/offsetInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/limitInQuery"
|
|
}, {
|
|
"$ref": "#/parameters/sortInQuery"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"apiMetaDataModel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "status"
|
|
},
|
|
"links": {
|
|
"$ref": "#/definitions/linksModel"
|
|
},
|
|
"collection": {
|
|
"$ref": "#/definitions/paginationModel"
|
|
}
|
|
},
|
|
"description": "A wrapper on all responses providing useful information related to the API call."
|
|
},
|
|
"radarMetadataModel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"description": "This is the unique case-sensitive radar code."
|
|
},
|
|
"location": {
|
|
"type": "string",
|
|
"description": "The location of the radar."
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"description": "The Australian state or territory the radar covers."
|
|
},
|
|
"online": {
|
|
"type": "boolean",
|
|
"description": "Informational field indicating the ongoing status of a radar. This is set manually by DPIRD depending on the availability of the radar from BOM."
|
|
},
|
|
"offlineReason": {
|
|
"type": "string",
|
|
"description": "The reason the radar has been set offline. Null if radar is online."
|
|
},
|
|
"bounds": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number",
|
|
"format": "float"
|
|
}
|
|
},
|
|
"description": "Two latitude-longitude pairs that make up the radar's boundaries."
|
|
}
|
|
}
|
|
},
|
|
"radarLocationModel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"radarCode": {
|
|
"type": "string",
|
|
"description": "This is the unique case-sensitive radar code."
|
|
},
|
|
"latitude": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "The latitude of the radar point."
|
|
},
|
|
"longitude": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "The longitude of the radar point."
|
|
},
|
|
"dataSet": {
|
|
"type": "string",
|
|
"description": "The BOM Rainfields dataset used"
|
|
},
|
|
"distance": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "The distance from the supplied latitude / longitude pair in meters."
|
|
}
|
|
}
|
|
},
|
|
"rainfallModel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"dateTime": {
|
|
"type": "string",
|
|
"description": "dateTime"
|
|
},
|
|
"radar": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"description": "code"
|
|
},
|
|
"latitude": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "A latitude that will be used to find the nearest radar point."
|
|
},
|
|
"longitude": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "A longitude that will be used to find the nearest radar point."
|
|
},
|
|
"distance": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "distance"
|
|
},
|
|
"dataSet": {
|
|
"type": "string",
|
|
"description": "dataSet"
|
|
}
|
|
},
|
|
"description": "radar"
|
|
},
|
|
"rainfall": {
|
|
"type": "object",
|
|
"properties": {
|
|
"currentHour": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "currentHour"
|
|
},
|
|
"monthToDate": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "monthToDate"
|
|
},
|
|
"yearToDate": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "yearToDate"
|
|
}
|
|
},
|
|
"description": "Rainfall"
|
|
}
|
|
},
|
|
"description": "data"
|
|
},
|
|
"rainfallSummaryModel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"period": {
|
|
"type": "object",
|
|
"properties": {
|
|
"from": {
|
|
"type": "string",
|
|
"description": "The start of the specified interval in UTC. The time returned for the monthly and yearly interval will be midnight at the start of the calendar month/year."
|
|
},
|
|
"to": {
|
|
"type": "string",
|
|
"description": "The end of the specified interval in UTC. The time returned for the monthly and yearly interval will be midnight at the start of the calendar month/year."
|
|
},
|
|
"year": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "This is the year value that the summary relates to."
|
|
},
|
|
"month": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "This is the month value that the summary relates to."
|
|
},
|
|
"day": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "This is the day of the month that the summary relates to."
|
|
},
|
|
"hour": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "This is the 24-hour value that the summary relates to."
|
|
},
|
|
"minute": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "This is the minute value that the summary data relates to. In case of a 15 minute or 30 minute interval, the minute value will represent the end of the interval.",
|
|
"title": ""
|
|
}
|
|
},
|
|
"description": "The calendar based time-period of the specified interval. For monthly and yearly intervals, standard calendar periods are used for the period bounds rather than the actual summary periods. Please note the actual summary period for monthly and yearly are based on daily summaries, so accordingly the corresponding measurements that are offset from midnight will start at 9am the day before the period or finish at 9am the day after the period."
|
|
},
|
|
"rainfall": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "The estimated monthly rainfall",
|
|
"title": ""
|
|
}
|
|
}
|
|
},
|
|
"radarLocationModel2": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"description": "The code of the radar used to create the estimate"
|
|
},
|
|
"latitude": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "The latitude of the radar point used to create the estimate"
|
|
},
|
|
"longitude": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"description": "The longitude of the radar point used to create the estimate"
|
|
},
|
|
"distance": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "The distance in meters from the requested lat/long to the radar point used."
|
|
}
|
|
},
|
|
"description": "details of the radar point used to generate the estimate"
|
|
},
|
|
"paginationModel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "count"
|
|
},
|
|
"limit": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "limit"
|
|
},
|
|
"offset": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"description": "offset"
|
|
},
|
|
"links": {
|
|
"$ref": "#/definitions/linksModel"
|
|
}
|
|
},
|
|
"description": "Pagination details"
|
|
},
|
|
"linksModel": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"title": "Links",
|
|
"properties": {
|
|
"href": {
|
|
"type": "string",
|
|
"description": "Specifies the URL of the page the link goes to.",
|
|
"title": "URL"
|
|
},
|
|
"rel": {
|
|
"type": "string",
|
|
"description": "Specifies the relationship between the current document and the linked document.",
|
|
"title": "Relationship"
|
|
}
|
|
}
|
|
},
|
|
"description": "A series of links related to the endpoint."
|
|
}
|
|
},
|
|
"parameters": {
|
|
"offsetInQuery": {
|
|
"name": "offset",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "integer",
|
|
"x-ms-summary": "Query Offset",
|
|
"description": "The pagination offset parameter specifies the first entry to return from a collection."
|
|
},
|
|
"limitInQuery": {
|
|
"name": "limit",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "integer",
|
|
"x-ms-summary": "Number of records to retrieve",
|
|
"description": "The pagination limit parameter restricts the number of entries returned."
|
|
},
|
|
"sortInQuery": {
|
|
"name": "sort",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"description": "A comma separated list of fields to sort by. Defaults to ascending. Prepend '-' for descending. For wind fields you can only sort or select by the lowest sensor.",
|
|
"x-ms-summary": "Fields to sort by"
|
|
},
|
|
"radarCodesInQuery" : {
|
|
"name": "radarCode",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"description": "A comma separated list of case-sensitive radar codes. Limits the radars which will be returned.",
|
|
"x-ms-summary": "Radar code(s)"
|
|
},
|
|
"radarCodeInQueryLookup" : {
|
|
"name": "radarCode",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"description": "A comma separated list of case-sensitive radar codes. Limits the radars which will be returned.",
|
|
"x-ms-summary": "Radar code(s)",
|
|
"x-ms-dynamic-values": {
|
|
"operationId": "GetRadars",
|
|
"value-path": "code",
|
|
"value-collection": "collection",
|
|
"value-title": "location"
|
|
}
|
|
},
|
|
"radarCodeInPathLookup": {
|
|
"name": "radarCode",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string",
|
|
"description": "A single case-sensitive radar code.",
|
|
"x-ms-summary": "Radar Code",
|
|
"x-ms-url-encoding" : "single",
|
|
"x-ms-dynamic-values": {
|
|
"operationId": "GetRadars",
|
|
"value-path": "code",
|
|
"value-collection": "collection",
|
|
"value-title": "location"
|
|
}
|
|
},
|
|
"radarSelectFieldsInQuery" : {
|
|
"name": "select",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"description": "A comma separated list of fields to include in the result. Note that this will not include radar codes or names unless explicitly included",
|
|
"x-ms-summary": "Fields to include in the result",
|
|
"default": "code,location,state,bounds,online,offline_reason"
|
|
},
|
|
"rainfallSelectFieldsInQuery" : {
|
|
"name": "select",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"default": "dateTime,radar,radarCode,radarDistance,radarLatitude,radarLongitude,rainfall,rainfallCurrentHour,rainfallMonthToDate,rainfallSince9am,rainfallYrarToDate",
|
|
"description": "A comma separated list of fields to include in the result. Note that this will not include radar codes or names unless explicitly included.",
|
|
"x-ms-summary": "Fields to include in the result"
|
|
},
|
|
"summarySelectFieldsInQuery" : {
|
|
"name": "select",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"default": "radar,radarCode,radarLatitude,radarLongitude,radarDistance,period,periodFrom,periodTo,periodYear,periodMonth,periodDay,periodHour,periodMinute,rainfall",
|
|
"description": "A comma separated list of fields to include in the result. Note that this will not include radar codes or names unless explicitly included.",
|
|
"x-ms-summary": "Fields to include in result"
|
|
},
|
|
"latitudeInQueryRequired" : {
|
|
"name": "latitude",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "number",
|
|
"description": "A latitude in decimal format.",
|
|
"x-ms-summary": "Latitude"
|
|
},
|
|
"longitudeInQueryRequired" : {
|
|
"name": "longitude",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "number",
|
|
"description": "A longitude in decimal format.",
|
|
"x-ms-summary": "Longitude"
|
|
},
|
|
"dataSetInQuery" : {
|
|
"name": "dataSet",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"default": "ALL",
|
|
"description": "Select the BOM Rainfields dataset to use. Case sensitive.",
|
|
"x-ms-summary": "BOM Rainfields dataset",
|
|
"enum": [
|
|
"RF3",
|
|
"RF2",
|
|
"ALL"
|
|
]
|
|
},
|
|
"startMonthInQuery" : {
|
|
"name": "startMonth",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string",
|
|
"description": "The start date in YYYY-MM format",
|
|
"x-ms-summary": "Start Month"
|
|
},
|
|
"endMonthInQuery" : {
|
|
"name": "endMonth",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string",
|
|
"description": "The end date in YYYY-MM format",
|
|
"x-ms-summary": "End Month"
|
|
},
|
|
"startDateInQuery" : {
|
|
"name": "startDate",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string",
|
|
"description": "The start date in YYYY-MM-DD format",
|
|
"x-ms-summary": "Start Date"
|
|
},
|
|
"endDateInQuery" : {
|
|
"name": "endDate",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string",
|
|
"description": "The end date in YYYY-MM-DD format",
|
|
"x-ms-summary": "End Date"
|
|
}
|
|
},
|
|
"responses": {},
|
|
"x-ms-connector-metadata": [{
|
|
"propertyName": "Website",
|
|
"propertyValue": "https://www.agric.wa.gov.au/"
|
|
}, {
|
|
"propertyName": "Privacy Policy",
|
|
"propertyValue": "https://www.agric.wa.gov.au/apis/api-terms-and-conditions"
|
|
}, {
|
|
"propertyName": "Categories",
|
|
"propertyValue": "Business Intelligence; Data"
|
|
}
|
|
],
|
|
"securityDefinitions": {
|
|
"API Key": {
|
|
"type": "apiKey",
|
|
"in": "header",
|
|
"name": "api-key"
|
|
}
|
|
},
|
|
"security": [{
|
|
"API Key": []
|
|
}
|
|
],
|
|
"tags": []
|
|
}
|