|
75 | 75 | "tags": [ |
76 | 76 | "Datasets" |
77 | 77 | ], |
78 | | - "summary": "Creates a new dataset referencing files. Users can reference previously uploaded files. Admins can reference files from a volume.", |
| 78 | + "summary": "Creates a new dataset referencing files.", |
| 79 | + "description": "Users can reference previously uploaded files.\nAdmins can reference files from a volume.", |
79 | 80 | "operationId": "create_dataset_handler", |
80 | 81 | "requestBody": { |
81 | 82 | "content": { |
82 | 83 | "application/json": { |
83 | 84 | "schema": { |
84 | 85 | "$ref": "#/components/schemas/CreateDataset" |
85 | | - }, |
86 | | - "examples": { |
87 | | - "Germany Border": { |
88 | | - "value": { |
89 | | - "dataPath": { |
90 | | - "upload": "420b06de-0a7e-45cb-9c1c-ea901b46ab69" |
91 | | - }, |
92 | | - "definition": { |
93 | | - "properties": { |
94 | | - "name": "germany_border", |
95 | | - "displayName": "Germany Border", |
96 | | - "description": "The Outline of Germany", |
97 | | - "sourceOperator": "OgrSource" |
98 | | - }, |
99 | | - "metaData": { |
100 | | - "type": "OgrMetaData", |
101 | | - "loadingInfo": { |
102 | | - "fileName": "germany_polygon.gpkg", |
103 | | - "layerName": "test_germany", |
104 | | - "dataType": "MultiPolygon", |
105 | | - "time": { |
106 | | - "type": "none" |
107 | | - }, |
108 | | - "columns": { |
109 | | - "x": "", |
110 | | - "y": null, |
111 | | - "text": [], |
112 | | - "float": [], |
113 | | - "int": [], |
114 | | - "bool": [], |
115 | | - "datetime": [] |
116 | | - }, |
117 | | - "forceOgrTimeFilter": false, |
118 | | - "onError": "ignore" |
119 | | - }, |
120 | | - "resultDescriptor": { |
121 | | - "dataType": "MultiPolygon", |
122 | | - "spatialReference": "EPSG:4326", |
123 | | - "columns": {} |
124 | | - } |
125 | | - } |
126 | | - } |
127 | | - } |
128 | | - }, |
129 | | - "Plain Data": { |
130 | | - "value": { |
131 | | - "dataPath": { |
132 | | - "upload": "f3bd61ef-d9ce-471c-89a1-46b5f7295886" |
133 | | - }, |
134 | | - "definition": { |
135 | | - "properties": { |
136 | | - "name": "plain_data", |
137 | | - "displayName": "Plain Data", |
138 | | - "description": "Demo Dataset", |
139 | | - "sourceOperator": "OgrSource" |
140 | | - }, |
141 | | - "metaData": { |
142 | | - "type": "OgrMetaData", |
143 | | - "loadingInfo": { |
144 | | - "fileName": "plain_data.csv", |
145 | | - "layerName": "plain_data", |
146 | | - "dataType": "Data", |
147 | | - "time": { |
148 | | - "type": "none" |
149 | | - }, |
150 | | - "columns": { |
151 | | - "x": "", |
152 | | - "y": null, |
153 | | - "text": [], |
154 | | - "float": [], |
155 | | - "int": [ |
156 | | - "a" |
157 | | - ] |
158 | | - }, |
159 | | - "forceOgrTimeFilter": false, |
160 | | - "onError": "abort" |
161 | | - }, |
162 | | - "resultDescriptor": { |
163 | | - "dataType": "Data", |
164 | | - "spatialReference": "EPSG:4326", |
165 | | - "columns": { |
166 | | - "a": { |
167 | | - "dataType": "int", |
168 | | - "measurement": { |
169 | | - "type": "unitless" |
170 | | - } |
171 | | - } |
172 | | - } |
173 | | - } |
174 | | - } |
175 | | - } |
176 | | - } |
177 | | - } |
178 | 86 | } |
179 | 87 | } |
180 | 88 | }, |
|
183 | 91 | "responses": { |
184 | 92 | "200": { |
185 | 93 | "$ref": "#/components/responses/DatasetNameResponse" |
186 | | - }, |
187 | | - "400": { |
188 | | - "description": "Bad request", |
189 | | - "content": { |
190 | | - "application/json": { |
191 | | - "schema": { |
192 | | - "$ref": "#/components/schemas/ErrorResponse" |
193 | | - }, |
194 | | - "examples": { |
195 | | - "Admin tried to create dataset from an upload": { |
196 | | - "value": { |
197 | | - "error": "AdminsCannotCreateDatasetFromUpload", |
198 | | - "message": "Admins cannot create dataset from upload" |
199 | | - } |
200 | | - }, |
201 | | - "Body is invalid json": { |
202 | | - "value": { |
203 | | - "error": "BodyDeserializeError", |
204 | | - "message": "expected `,` or `}` at line 13 column 7" |
205 | | - } |
206 | | - }, |
207 | | - "Failed to read body": { |
208 | | - "value": { |
209 | | - "error": "Payload", |
210 | | - "message": "Error that occur during reading payload: Can not decode content-encoding." |
211 | | - } |
212 | | - }, |
213 | | - "Filepath in metadata is invalid": { |
214 | | - "value": { |
215 | | - "error": "CannotResolveUploadFilePath", |
216 | | - "message": "CannotResolveUploadFilePath: PathIsNotAFile" |
217 | | - } |
218 | | - }, |
219 | | - "Normal user tried to create dataset from a volume": { |
220 | | - "value": { |
221 | | - "error": "OnlyAdminsCanCreateDatasetFromVolume", |
222 | | - "message": "Only admins can create dataset from volume" |
223 | | - } |
224 | | - }, |
225 | | - "Referenced an unknown upload": { |
226 | | - "value": { |
227 | | - "error": "UploadNotFound", |
228 | | - "message": "UploadNotFound: UnknownUploadId" |
229 | | - } |
230 | | - }, |
231 | | - "Referenced an unknown volume": { |
232 | | - "value": { |
233 | | - "error": "UnknownVolume", |
234 | | - "message": "Unknown volume" |
235 | | - } |
236 | | - } |
237 | | - } |
238 | | - } |
239 | | - } |
240 | | - }, |
241 | | - "401": { |
242 | | - "$ref": "#/components/responses/UnauthorizedUserResponse" |
243 | | - }, |
244 | | - "413": { |
245 | | - "$ref": "#/components/responses/PayloadTooLargeResponse" |
246 | | - }, |
247 | | - "415": { |
248 | | - "$ref": "#/components/responses/UnsupportedMediaTypeForJsonResponse" |
249 | | - }, |
250 | | - "500": { |
251 | | - "description": "Internal server error", |
252 | | - "content": { |
253 | | - "application/json": { |
254 | | - "schema": { |
255 | | - "$ref": "#/components/schemas/ErrorResponse" |
256 | | - }, |
257 | | - "examples": { |
258 | | - "Cannot access config": { |
259 | | - "value": { |
260 | | - "error": "CannotAccessConfig", |
261 | | - "message": "CannotAccessConfig: ConfigLockFailed" |
262 | | - } |
263 | | - }, |
264 | | - "Failed to access database": { |
265 | | - "value": { |
266 | | - "error": "DatabaseAccessError", |
267 | | - "message": "DatabaseAccessError: connection closed" |
268 | | - } |
269 | | - } |
270 | | - } |
271 | | - } |
272 | | - } |
273 | 94 | } |
274 | 95 | }, |
275 | 96 | "security": [ |
|
2360 | 2181 | }, |
2361 | 2182 | "responses": { |
2362 | 2183 | "200": { |
2363 | | - "description": "" |
| 2184 | + "description": "", |
| 2185 | + "content": { |
| 2186 | + "application/json": { |
| 2187 | + "schema": { |
| 2188 | + "$ref": "#/components/schemas/MlModelNameResponse" |
| 2189 | + } |
| 2190 | + } |
| 2191 | + } |
2364 | 2192 | } |
2365 | 2193 | }, |
2366 | 2194 | "security": [ |
|
6059 | 5887 | ], |
6060 | 5888 | "properties": { |
6061 | 5889 | "id": { |
6062 | | - "$ref": "#/components/schemas/DatasetId" |
| 5890 | + "$ref": "#/components/schemas/DatasetName" |
6063 | 5891 | }, |
6064 | 5892 | "type": { |
6065 | 5893 | "type": "string", |
|
7046 | 6874 | "MlModelName": { |
7047 | 6875 | "type": "string" |
7048 | 6876 | }, |
| 6877 | + "MlModelNameResponse": { |
| 6878 | + "type": "object", |
| 6879 | + "required": [ |
| 6880 | + "mlModelName" |
| 6881 | + ], |
| 6882 | + "properties": { |
| 6883 | + "mlModelName": { |
| 6884 | + "$ref": "#/components/schemas/MlModelName" |
| 6885 | + } |
| 6886 | + } |
| 6887 | + }, |
| 6888 | + "MlModelResource": { |
| 6889 | + "type": "object", |
| 6890 | + "title": "MlModelResource", |
| 6891 | + "required": [ |
| 6892 | + "type", |
| 6893 | + "id" |
| 6894 | + ], |
| 6895 | + "properties": { |
| 6896 | + "id": { |
| 6897 | + "$ref": "#/components/schemas/MlModelName" |
| 6898 | + }, |
| 6899 | + "type": { |
| 6900 | + "type": "string", |
| 6901 | + "enum": [ |
| 6902 | + "mlModel" |
| 6903 | + ] |
| 6904 | + } |
| 6905 | + } |
| 6906 | + }, |
7049 | 6907 | "MockDatasetDataSourceLoadingInfo": { |
7050 | 6908 | "type": "object", |
7051 | 6909 | "required": [ |
|
7760 | 7618 | "PermissionListing": { |
7761 | 7619 | "type": "object", |
7762 | 7620 | "required": [ |
7763 | | - "resourceId", |
| 7621 | + "resource", |
7764 | 7622 | "role", |
7765 | 7623 | "permission" |
7766 | 7624 | ], |
7767 | 7625 | "properties": { |
7768 | 7626 | "permission": { |
7769 | 7627 | "$ref": "#/components/schemas/Permission" |
7770 | 7628 | }, |
7771 | | - "resourceId": { |
7772 | | - "$ref": "#/components/schemas/ResourceId" |
| 7629 | + "resource": { |
| 7630 | + "$ref": "#/components/schemas/Resource" |
7773 | 7631 | }, |
7774 | 7632 | "role": { |
7775 | 7633 | "$ref": "#/components/schemas/Role" |
|
8496 | 8354 | }, |
8497 | 8355 | { |
8498 | 8356 | "$ref": "#/components/schemas/DatasetResource" |
| 8357 | + }, |
| 8358 | + { |
| 8359 | + "$ref": "#/components/schemas/MlModelResource" |
8499 | 8360 | } |
8500 | 8361 | ], |
8501 | 8362 | "discriminator": { |
|
8504 | 8365 | "dataset": "#/components/schemas/DatasetResource", |
8505 | 8366 | "layer": "#/components/schemas/LayerResource", |
8506 | 8367 | "layerCollection": "#/components/schemas/LayerCollectionResource", |
| 8368 | + "mlModel": "#/components/schemas/MlModelResource", |
8507 | 8369 | "project": "#/components/schemas/ProjectResource" |
8508 | 8370 | } |
8509 | 8371 | } |
|
0 commit comments