-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π merge: Merge remote-tracking branch 'github/dev'
- Loading branch information
Showing
85 changed files
with
2,888 additions
and
1,597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = fastapi_gateway_auto_generate/tmp/*, fastapi_gateway_auto_generate/migration/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,4 +168,5 @@ test.py | |
*.ipynb | ||
|
||
allureress/ | ||
allure-report/ | ||
main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.models.RouteModel.RouteModel | ||
options: | ||
show_root_heading: true |
3 changes: 3 additions & 0 deletions
3
docs/CodeReference/domain/usecases/BuildRouteModelsUsecase.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.usecases.BuildRouteModelsUsecase.BuildRouteModelsUsecase | ||
options: | ||
show_root_heading: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.usecases.BuildRoutesUsecase.BuildRoutesUsecase | ||
options: | ||
show_root_heading: true |
3 changes: 3 additions & 0 deletions
3
docs/CodeReference/domain/usecases/DeleteTmpModelsFilesUsecase.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.usecases.DeleteTmpModelsFilesUsecase.DeleteTmpModelsFilesUsecase | ||
options: | ||
show_root_heading: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.usecases.InitDatabaseUsecase.InitDatabaseUsecase | ||
options: | ||
show_root_heading: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.usecases.RefreshServicesUsecase.RefreshServicesUsecase | ||
options: | ||
show_root_heading: true |
3 changes: 3 additions & 0 deletions
3
docs/CodeReference/domain/usecases/UpdateOpenApiSchemaUsecase.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.domain.usecases.UpdateOpenApiSchemaUsecase.UpdateOpenApiSchemaUsecase | ||
options: | ||
show_root_heading: true |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
::: fastapi_gateway_auto_generate.Generator | ||
options: | ||
show_root_heading: true | ||
|
||
::: fastapi_gateway_auto_generate.Config | ||
options: | ||
show_root_heading: true | ||
|
||
!!! warning | ||
The **`service_management`** parameter is temporarily not functioning and will always be set to `True`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.management.Management | ||
options: | ||
show_root_heading: true |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.management.routes.AddServiceRoute | ||
options: | ||
show_root_heading: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.management.routes.DeleteServiceRoute | ||
options: | ||
show_root_heading: true |
3 changes: 3 additions & 0 deletions
3
docs/CodeReference/management/routes/GetAllInfoServicesRoute.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.management.routes.GetAllInfoServicesRoute | ||
options: | ||
show_root_heading: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
::: fastapi_gateway_auto_generate.management.routes.RefreshServicesRoute | ||
options: | ||
show_root_heading: true |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
docs/Usage/FileManipulation/HTTP_HTTPS/FileRetrievalFromTheService.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# File retrieval from the services | ||
|
||
## Service | ||
|
||
In this example, a service implemented through FastAPI will be used. | ||
If you have a service implemented in another programming language, | ||
the main requirement is to transfer the file in binary format with the header (application/octet-stream). | ||
To pass a file through FastAPI, you can use FileResponse | ||
(more details can be found in the official documentation: https://fastapi.tiangolo.com/advanced/custom-response/#fileresponse)." | ||
|
||
## API-Gateway | ||
|
||
!!! bug | ||
It is not possible to download a file through Swagger, as when sending a request, | ||
the API-Gateway starts streaming byte streams, which can cause the page or the entire browser to crash. | ||
|
||
To solve the file download issue, you can either directly paste the URL in the browser, | ||
use some third-party tools, or use a programming language. | ||
|
||
An example of downloading and saving a file using Python: | ||
|
||
```python | ||
import requests | ||
|
||
cookies = {'rinex_to_csv_processing_id': '0000000000000000001'} | ||
|
||
url = 'http://127.0.0.1:8080/rinex/rinex_to_csv/get_result' | ||
r = requests.get(url, allow_redirects=True, cookies=cookies) | ||
|
||
if r.status_code == 200: | ||
open('save.zip', 'wb').write(r.content) | ||
``` |
1 change: 1 addition & 0 deletions
1
docs/Usage/FileManipulation/HTTP_HTTPS/FileTransferToTheService.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# File transfer to the service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
This method is suitable for transferring small files between the service and API-Gateway. | ||
If you plan to transfer files larger than 500 MB, | ||
it is recommended to consider using the method through a [broker](/Usage/FileManipulation/http-https/). | ||
|
||
## File transfer to the service | ||
|
||
## File retrieval from the services | ||
|
||
### 1. Service | ||
|
||
In this example, a service implemented through FastAPI will be used. | ||
If you have a service implemented in another programming language, | ||
the main requirement is to transfer the file in binary format with the header `application/octet-stream`. | ||
|
||
To pass a file through FastAPI, you can use FileResponse | ||
(more details can be found in the official documentation: https://fastapi.tiangolo.com/advanced/custom-response/#fileresponse)." | ||
|
||
Example of sending a file to an API Gateway: | ||
|
||
```python | ||
import os | ||
from fastapi.responses import FileResponse | ||
from fastapi import FastAPI, HTTPException, Cookie | ||
from pathlib import Path | ||
from collections import defaultdict | ||
|
||
processings = defaultdict(dict) | ||
|
||
temdir = Path('/tmp/files') | ||
|
||
app = FastAPI() | ||
|
||
|
||
@app.get("/get_result", tags=["default"]) | ||
async def get_result(processing_id: str | None = Cookie(default=None)): | ||
|
||
if not processing_id: | ||
HTTPException(status_code=400, detail="Upload files first") | ||
if not processing_id in processings: | ||
raise HTTPException(status_code=404, detail="No such proc_id") | ||
if not os.path.exists(temdir / processing_id / 'out'): | ||
raise HTTPException(status_code=425, | ||
detail = "Run processing first") | ||
|
||
files = os.listdir(temdir / processing_id / "out") | ||
files = [f for f in files if f.endswith('zip')] | ||
out_file = temdir / processing_id / 'out' / files[0] | ||
|
||
return FileResponse(out_file, | ||
filename = files[0], | ||
media_type="application/octet-stream") | ||
``` | ||
|
||
### 2. API-Gateway | ||
|
||
!!! bug | ||
It is not possible to download a file through Swagger, as when sending a request, | ||
the API-Gateway starts streaming byte streams, which can cause the page or the entire browser to crash. | ||
|
||
To solve the file download issue, you can either directly paste the URL in the browser, | ||
use some third-party tools, or use a programming language. | ||
|
||
An example of downloading and saving a file using Python: | ||
|
||
```python | ||
import requests | ||
|
||
cookies = {'processing_id': '0000000000000000001'} | ||
|
||
url = 'http://127.0.0.1:8080/service/get_result' | ||
r = requests.get(url, allow_redirects=True, cookies=cookies) | ||
|
||
if r.status_code == 200: | ||
open('save.zip', 'wb').write(r.content) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Security | ||
|
||
!!! info | ||
This functionality has not yet been implemented |
Oops, something went wrong.