-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCopernicusAPI_swagger.yaml
206 lines (205 loc) · 5.63 KB
/
CopernicusAPI_swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
swagger: '2.0'
info:
title: ECMWF API
description: Sample API using the ECMWF Wrapper library
version: 1.0.0
host: '0.0.0.0:5055'
produces:
- application/json
paths:
/:
get:
summary: Check if the API is running.
description: >
The Products endpoint returns a simple Greet message to check if a
connection is possible.
responses:
'200':
description: Greeting message
tags:
- ECMWF
/files:
get:
summary: Returns a list of all available files for parsing.
description: |
Lists all available grib files that have been downloaded already.
responses:
'200':
description: Returns all available filenames
schema:
$ref: '#/definitions/FileListValue'
tags:
- ECMWF
/retrieve:
get:
summary: Triggers the retrieval of the grib file for the given date.
description: >
This method can trigger the download of additional grib files if a date
is given that currently is not downloaded. If the user queries an
existing file the fileName will be returned immediately.
parameters:
- name: timestamp
in: query
description: 'ISO String timestamp (ex. 2017-09-15T15:21:20%2B00:00)'
required: true
type: string
format: date-time
tags:
- ECMWF
responses:
'200':
description: >-
Returns the filename of the file that contains the data for the
given date.
schema:
$ref: '#/definitions/RetrievealReturnValue'
'404':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/parse/{fileName}':
get:
summary: parse data from the given grib file.
description: >
Parses the given file in the URL and searches for data for the latitude,
longitude and date given via query parameters.
parameters:
- name: fileName
in: path
description: Filename of the grib file we want to check
required: true
type: string
- name: timestamp
in: query
description: 'ISO String timestamp (ex. 2017-09-15T15:21:20%2B00:00)'
required: true
type: string
format: date-time
- name: lat
in: query
description: Latitude of the location
required: true
type: number
- name: lon
in: query
description: Longitude of the location
required: true
type: number
tags:
- ECMWF
responses:
'200':
description: >-
Parses the specified grib files for related values. In turn will
return a single object that contains all queried parameters
("PARAM_NAME" is the placeholder to show the structure) that contain
an array of ECMWF parameters.
schema:
$ref: '#/definitions/ParseReturnValue'
'404':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/parse':
get:
summary: parse data from the given grib file.
description: >
Determines the file name by using the given date. Uses
longitude and date given via query parameters to retrieve the data.
parameters:
- name: timestamp
in: query
description: 'ISO String timestamp (ex. 2017-09-15T15:21:20%2B00:00)'
required: true
type: string
format: date-time
- name: lat
in: query
description: Latitude of the location
required: true
type: number
- name: lon
in: query
description: Longitude of the location
required: true
type: number
tags:
- ECMWF
responses:
'200':
description: >-
Parses the specified grib files for related values. In turn will
return a single object that contains all queried parameters
("PARAM_NAME" is the placeholder to show the structure) that contain
an array of ECMWF parameters.
schema:
$ref: '#/definitions/ParseReturnValue'
'404':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
CopernicusData:
type: object
properties:
index:
type: integer
description:
type: object
properties:
dataTime:
type: integer
name:
type: string
units:
type: string
step:
type: integer
date:
type: integer
shortName:
type: string
paramId:
type: integer
convertedUnit:
type: string
classification:
type: string
distance:
type: number
longitude:
type: number
latitude:
type: number
value:
type: number
date:
type: string
type:
type: string
FileListValue:
type: object
properties:
files:
type: array
items:
type: string
ParseReturnValue:
type: object
properties:
PARAM_NAME:
type: array
items:
$ref: '#/definitions/CopernicusData'
description: name of the retrieved file
RetrievealReturnValue:
type: object
properties:
fileName:
type: string
description: name of the retrieved file
Error:
type: object
properties:
message:
type: string