Skip to content

Commit 1ed4838

Browse files
Clarify API
1 parent f97a93f commit 1ed4838

11 files changed

Lines changed: 99 additions & 97 deletions

File tree

python-restclient/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ Class | Method | HTTP request | Description
9393
*BioModelResourceApi* | [**delete_bio_model**](docs/BioModelResourceApi.md#delete_bio_model) | **DELETE** /api/v1/bioModel/{bioModelID} | Delete the BioModel from VCell's database.
9494
*BioModelResourceApi* | [**get_biomodel_by_id**](docs/BioModelResourceApi.md#get_biomodel_by_id) | **GET** /api/v1/bioModel/{bioModelID} | Get BioModel information in JSON format by ID.
9595
*BioModelResourceApi* | [**upload_bio_model**](docs/BioModelResourceApi.md#upload_bio_model) | **POST** /api/v1/bioModel/upload_bioModel | Upload the BioModel to VCell database. Returns BioModel ID.
96-
*FieldDataResourceApi* | [**analyze_file**](docs/FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
96+
*FieldDataResourceApi* | [**analyze_file**](docs/FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
9797
*FieldDataResourceApi* | [**copy_models_field_data**](docs/FieldDataResourceApi.md#copy_models_field_data) | **POST** /api/v1/fieldData/copyModelsFieldData | Copy all existing field data from a BioModel/MathModel that you have access to, but don't own.
98-
*FieldDataResourceApi* | [**create_from_analyzed_file**](docs/FieldDataResourceApi.md#create_from_analyzed_file) | **POST** /api/v1/fieldData/createFromAnalyzedFile | Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
98+
*FieldDataResourceApi* | [**create_from_analyzed_file**](docs/FieldDataResourceApi.md#create_from_analyzed_file) | **POST** /api/v1/fieldData/createFromSpecification | Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
9999
*FieldDataResourceApi* | [**create_from_simulation**](docs/FieldDataResourceApi.md#create_from_simulation) | **POST** /api/v1/fieldData/createFromSimulation | Create new field data from existing simulation results.
100100
*FieldDataResourceApi* | [**delete**](docs/FieldDataResourceApi.md#delete) | **DELETE** /api/v1/fieldData/delete/{fieldDataID} | Delete the selected field data.
101101
*FieldDataResourceApi* | [**get_all_ids**](docs/FieldDataResourceApi.md#get_all_ids) | **GET** /api/v1/fieldData/IDs | Get all of the ids used to identify, and retrieve field data.

python-restclient/docs/FieldDataResourceApi.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ All URIs are relative to *https://vcell-dev.cam.uchc.edu*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**analyze_file**](FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
7+
[**analyze_file**](FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
88
[**copy_models_field_data**](FieldDataResourceApi.md#copy_models_field_data) | **POST** /api/v1/fieldData/copyModelsFieldData | Copy all existing field data from a BioModel/MathModel that you have access to, but don't own.
9-
[**create_from_analyzed_file**](FieldDataResourceApi.md#create_from_analyzed_file) | **POST** /api/v1/fieldData/createFromAnalyzedFile | Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
9+
[**create_from_analyzed_file**](FieldDataResourceApi.md#create_from_analyzed_file) | **POST** /api/v1/fieldData/createFromSpecification | Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
1010
[**create_from_simulation**](FieldDataResourceApi.md#create_from_simulation) | **POST** /api/v1/fieldData/createFromSimulation | Create new field data from existing simulation results.
1111
[**delete**](FieldDataResourceApi.md#delete) | **DELETE** /api/v1/fieldData/delete/{fieldDataID} | Delete the selected field data.
1212
[**get_all_ids**](FieldDataResourceApi.md#get_all_ids) | **GET** /api/v1/fieldData/IDs | Get all of the ids used to identify, and retrieve field data.
@@ -16,7 +16,7 @@ Method | HTTP request | Description
1616
# **analyze_file**
1717
> AnalyzedFile analyze_file(file=file, file_name=file_name)
1818
19-
Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
19+
Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
2020

2121
### Example
2222

@@ -47,7 +47,7 @@ with vcell_client.ApiClient(configuration) as api_client:
4747
file_name = 'file_name_example' # str | (optional)
4848

4949
try:
50-
# Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
50+
# Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
5151
api_response = api_instance.analyze_file(file=file, file_name=file_name)
5252
print("The response of FieldDataResourceApi->analyze_file:\n")
5353
pprint(api_response)
@@ -161,7 +161,7 @@ Name | Type | Description | Notes
161161
# **create_from_analyzed_file**
162162
> FieldDataSavedResults create_from_analyzed_file(analyzed_file=analyzed_file)
163163
164-
Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
164+
Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
165165

166166
### Example
167167

@@ -192,7 +192,7 @@ with vcell_client.ApiClient(configuration) as api_client:
192192
analyzed_file = vcell_client.AnalyzedFile() # AnalyzedFile | (optional)
193193

194194
try:
195-
# Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
195+
# Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
196196
api_response = api_instance.create_from_analyzed_file(analyzed_file=analyzed_file)
197197
print("The response of FieldDataResourceApi->create_from_analyzed_file:\n")
198198
pprint(api_response)

python-restclient/vcell_client/api/field_data_resource_api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def analyze_file(
7171
_headers: Optional[Dict[StrictStr, Any]] = None,
7272
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
7373
) -> AnalyzedFile:
74-
"""Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
74+
"""Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
7575
7676
7777
:param file:
@@ -144,7 +144,7 @@ def analyze_file_with_http_info(
144144
_headers: Optional[Dict[StrictStr, Any]] = None,
145145
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
146146
) -> ApiResponse[AnalyzedFile]:
147-
"""Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
147+
"""Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
148148
149149
150150
:param file:
@@ -217,7 +217,7 @@ def analyze_file_without_preload_content(
217217
_headers: Optional[Dict[StrictStr, Any]] = None,
218218
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
219219
) -> RESTResponseType:
220-
"""Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
220+
"""Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores.
221221
222222
223223
:param file:
@@ -641,7 +641,7 @@ def create_from_analyzed_file(
641641
_headers: Optional[Dict[StrictStr, Any]] = None,
642642
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
643643
) -> FieldDataSavedResults:
644-
"""Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
644+
"""Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
645645
646646
647647
:param analyzed_file:
@@ -710,7 +710,7 @@ def create_from_analyzed_file_with_http_info(
710710
_headers: Optional[Dict[StrictStr, Any]] = None,
711711
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
712712
) -> ApiResponse[FieldDataSavedResults]:
713-
"""Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
713+
"""Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
714714
715715
716716
:param analyzed_file:
@@ -779,7 +779,7 @@ def create_from_analyzed_file_without_preload_content(
779779
_headers: Optional[Dict[StrictStr, Any]] = None,
780780
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
781781
) -> RESTResponseType:
782-
"""Take the Analyzed results of the field data, and save them to the server. User may adjust the analyzed file before uploading to edit defaults.
782+
"""Take the field data specification, and save it to the server. User may adjust the analyzed file before uploading to edit defaults.
783783
784784
785785
:param analyzed_file:
@@ -886,7 +886,7 @@ def _create_from_analyzed_file_serialize(
886886

887887
return self.api_client.param_serialize(
888888
method='POST',
889-
resource_path='/api/v1/fieldData/createFromAnalyzedFile',
889+
resource_path='/api/v1/fieldData/createFromSpecification',
890890
path_params=_path_params,
891891
query_params=_query_params,
892892
header_params=_header_params,

tools/openapi.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ paths:
212212
post:
213213
tags:
214214
- Field Data Resource
215-
summary: "Analyze the field data from supported files (Tiff, Zip, and Non-GPL\
216-
\ BioFormats). Please don't use color mapped images for the files (the colors\
217-
\ in those images will be interpreted as separate channels). Filenames must\
218-
\ be lowercase alphanumeric, and can contain underscores."
215+
summary: "Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and\
216+
\ create default field data specification. Color mapped images not supported\
217+
\ (the colors in those images will be interpreted as separate channels). Filenames\
218+
\ must be lowercase alphanumeric, and can contain underscores."
219219
operationId: analyzeFile
220220
requestBody:
221221
content:
@@ -270,32 +270,6 @@ paths:
270270
security:
271271
- openId:
272272
- user
273-
/api/v1/fieldData/createFromAnalyzedFile:
274-
post:
275-
tags:
276-
- Field Data Resource
277-
summary: "Take the Analyzed results of the field data, and save them to the\
278-
\ server. User may adjust the analyzed file before uploading to edit defaults."
279-
operationId: createFromAnalyzedFile
280-
requestBody:
281-
content:
282-
application/json:
283-
schema:
284-
$ref: '#/components/schemas/AnalyzedFile'
285-
responses:
286-
"200":
287-
description: OK
288-
content:
289-
application/json:
290-
schema:
291-
$ref: '#/components/schemas/FieldDataSavedResults'
292-
"401":
293-
description: Not Authorized
294-
"403":
295-
description: Not Allowed
296-
security:
297-
- openId:
298-
- user
299273
/api/v1/fieldData/createFromSimulation:
300274
post:
301275
tags:
@@ -325,6 +299,32 @@ paths:
325299
security:
326300
- openId:
327301
- user
302+
/api/v1/fieldData/createFromSpecification:
303+
post:
304+
tags:
305+
- Field Data Resource
306+
summary: "Take the field data specification, and save it to the server. User\
307+
\ may adjust the analyzed file before uploading to edit defaults."
308+
operationId: createFromAnalyzedFile
309+
requestBody:
310+
content:
311+
application/json:
312+
schema:
313+
$ref: '#/components/schemas/AnalyzedFile'
314+
responses:
315+
"200":
316+
description: OK
317+
content:
318+
application/json:
319+
schema:
320+
$ref: '#/components/schemas/FieldDataSavedResults'
321+
"401":
322+
description: Not Authorized
323+
"403":
324+
description: Not Allowed
325+
security:
326+
- openId:
327+
- user
328328
/api/v1/fieldData/delete/{fieldDataID}:
329329
delete:
330330
tags:

vcell-rest/src/main/java/org/vcell/restq/handlers/FieldData/FieldDataResource.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void createNewFieldDataFromSimulation(@RestForm String simKeyReference, @
101101
@RolesAllowed("user")
102102
@Produces(MediaType.APPLICATION_JSON)
103103
@Consumes(MediaType.MULTIPART_FORM_DATA)
104-
@Operation(operationId = "analyzeFile", summary = "Analyze the field data from supported files (Tiff, Zip, and Non-GPL BioFormats). Please don't use color mapped images for the files (the colors in those images will be interpreted as separate channels). " +
104+
@Operation(operationId = "analyzeFile", summary = "Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and create default field data specification. Color mapped images not supported (the colors in those images will be interpreted as separate channels). " +
105105
"Filenames must be lowercase alphanumeric, and can contain underscores.")
106106
public AnalyzedFile analyzeFieldData(@RestForm File file, @RestForm String fileName){
107107
try{
@@ -116,13 +116,13 @@ public AnalyzedFile analyzeFieldData(@RestForm File file, @RestForm String fileN
116116
}
117117

118118
@POST
119-
@Path("/createFromAnalyzedFile")
119+
@Path("/createFromSpecification")
120120
@RolesAllowed("user")
121121
@Produces(MediaType.APPLICATION_JSON)
122122
@Consumes(MediaType.APPLICATION_JSON)
123-
@Operation(operationId = "createFromAnalyzedFile", summary = "Take the Analyzed results of the field data, and save them to the server. " +
123+
@Operation(operationId = "createFromAnalyzedFile", summary = "Take the field data specification, and save it to the server. " +
124124
"User may adjust the analyzed file before uploading to edit defaults.")
125-
public FieldDataSavedResults createNewFieldDataFromFile(AnalyzedFile saveFieldData){
125+
public FieldDataSavedResults createNewFieldDataFromSpecification(AnalyzedFile saveFieldData){
126126
FieldDataSavedResults fieldDataSavedResults;
127127
try{
128128
User user = userRestDB.getUserFromIdentity(securityIdentity, UserRestDB.UserRequirement.REQUIRE_USER);
@@ -155,7 +155,9 @@ public Hashtable<String, ExternalDataIdentifier> copyFieldData(SourceModel sourc
155155
@Operation(operationId = "delete", summary = "Delete the selected field data.")
156156
public void deleteFieldData(@PathParam("fieldDataID") String fieldDataID){
157157
try{
158-
fieldDataDB.deleteFieldData(userRestDB.getUserFromIdentity(securityIdentity, UserRestDB.UserRequirement.REQUIRE_USER), fieldDataID);
158+
ExternalDataIdentifier edi = new ExternalDataIdentifier(new KeyValue(fieldDataID), userRestDB.getUserFromIdentity(securityIdentity, UserRestDB.UserRequirement.REQUIRE_USER),
159+
null);
160+
fieldDataDB.deleteFieldData(edi);
159161
} catch (DataAccessException e) {
160162
throw new WebApplicationException(e.getMessage(), HTTP.INTERNAL_SERVER_ERROR);
161163
}

0 commit comments

Comments
 (0)