Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This endpoint is available from version 2.1.0^

Warning

THIS ENDPOINT IS STILL UNDER DEVELOPMENT.

Import Endpoint

Import functionality for stages, pipelines, endpoints and configuration files.


You can set the overwriting capabilities from the config file inside the "IMPORT/EXPORT" section. If enabled, then the all the files coming from the .gea file will overwrite the old ones inside the API instance.


Code Block
languagejs
titleImport/Export section in config.py
'import_export': {
        'enable': True,
        'export_folder_path': join(SERVER_PATH, 'exports'),
        'import_overwrite': False
    }

Table of Contents
maxLevel2

Import .gea file

This endpoint allows you to import files exported from another GAIA API instance.

Body Parameters

ParameterTypeDescription
filefileThe .gea file to import, can be a stage, pipeline, endpoint or all files.
overwritestringIf you want to overwrite files at the time of importing. (OPTIONAL)
Info

The Parameters above needs to be part of a form (form-data), otherwise, the operation will fail.

Note
titleIMPORTANT

If you use this endpoint, after importing the .gea file, you need to RESTART the API in order to load the new files that were imported, so, if you have requests pending or it is being used at the moment, wait for those processes to end and restart the server using the Shutdown Endpoint.

Example

Code Block
languagebash
POST /es/api/v1/importer_import

Response

Successful Response [200]

Code Block
Import successful

Validation Error [422]

Code Block
{
  "detail": [
    {
      "loc": ["body", "file"],
      "msg": "Field required",
      "type": "value_error.missing"
    }
  ]
}

Export Endpoint

Export functionality for stages, pipelines, endpoints and configuration files.

We create .gea files inside the "exports" folder inside the root of the GAIA API instancein memory with all the files requested to export.

These .gea files may or may not have nested .gea files representing nested stages or pipelines related between each other.

You can set the export folder path to a custom folder in case you want the exports in another folder instead of the default "exports" folder.

Code Block
languagejs
titleImport/Export section in config.py
'import_export': {
        'enable': True,
        'export_folder_path': join(SERVER_PATH, 'exports'),
        'import_overwrite': False
    }

After the .geas are completed the compressed file is returned as a stream of data in the response of the endpoint request. You may need to save that stream as a file afterwards.

Export All

This endpoint allows you to export all stages, pipelines, endpoints enabled and configuration files into a .gea file that can be imported into another instance of GAIA API.

Parameters


Info

This endpoint does not require parameters.

Example

Code Block
languagebash
GET /es/api/v1/export/all

Response

Successful Response [200]

Code Block
Export successful

Export All (Stages)

This endpoint allows you to export all the stages into a .gea file. 

Parameters


Info

This endpoint does not require parameters.

Example

Code Block
languagebash
GET /es/api/v1/export/stage/all

Response

Successful Response [200]

Code Block
Export successful

Export Stage

This endpoint allows you to export a specific stage into a .gea file by its name. 

Parameters

ParameterTypeDescription
stage_namestringThe name of the stage to export.

Example

Code Block
languagebash
GET /es/api/v1/export/stage/{stage_name}

Response

Successful Response [200]

Code Block
Export successful

Export All (Pipelines)

This endpoint allows you to export all the pipelines into a .gea file with its own stages (if the pipeline has stages configured). 

Parameters


Info

This endpoint does not require parameters.

Example

Code Block
languagebash
GET /es/api/v1/export/pipeline/all

Response

Successful Response [200]

Code Block
Export successful

Export Pipeline

This endpoint allows you to export a specific pipeline into a .gea file by its name alongside its stages configured (if it has stages). 

Parameters

ParameterTypeDescription
pipeline_namestringThe name of the pipeline to export.

Example

Code Block
languagebash
GET /es/api/v1/export/pipeline/{pipeline_name}

Response

Successful Response [200]

Code Block
Export successful

Export All (API Endpoints)

This endpoint allows you to export all the endpoints into a .gea file with its own pipelines and stages (if the endpoint has a pipeline wrapper configured). 

Parameters


Info

This endpoint does not require parameters.

Example

Code Block
languagebash
GET /es/api/v1/export/endpoint/all

Response

Successful Response [200]

Code Block
Export successful

Export API Endpoint

This endpoint allows you to export a specific endpoint into a .gea file by its name alongside its pipeline/stages configured (if it has a pipeline wrapper). 

Parameters

ParameterTypeDescription
endpoint_namestringThe name of the endpoint to export.

Example

Code Block
languagebash
GET /es/api/v1/export/endpoint/{endpoint_name}

Response

Successful Response [200]

Code Block
Export successful

Export Config Endpoint

This endpoint allows you to export all config files into a .gea file (exluding pipelines and files not needed to start the server). 

Parameters


Info

This endpoint does not require parameters.


Example

Code Block
languagebash
GET /es/api/v1/export/config

Response

Successful Response [200]

Code Block
Export successful