Skip to content

EO4EU/kg-web-proto

Repository files navigation

API Documentation

Introduction

This API provides services for managing and querying EO datasets along with various management endpoints. The responses are standardized using a common response structure for consistency and ease of integration.

Available Endpoints

A) DatasetController

Route: api/dataset

Get Dataset Breakdown

    Method: GET
    Route: {id:int}/breakdown
    Parameters:
        id (int): The identifier of the dataset
    Response:
        GenericResponse<DatasetBreakdown>

Run Query

    Method: GET
    Route: query/{request}
    Parameters:
        request (string): The query request
        sourcesList (string, optional): Comma-delimited list of sources
    Response:
        GenericResponse<List<int>>

Get Information List (by IDs)

    Method: GET
    Route: {commaDelimitedValues}/information
    Parameters:
        commaDelimitedValues (string): Comma-delimited list of dataset IDs
    Response:
        GenericResponse<List<DatasetInformation>>

Get Information List (by Query)

    Method: GET
    Route: information
    Parameters:
        query (QueryList<int>): List of dataset IDs
    Response:
        GenericResponse<List<DatasetInformation>>

Generate Download Script

    Method: POST
    Route: generateScript
    Parameters:
        request (Request): The request options
    Response:
        GenericResponse<string>

Get Breakdown (by Request)

    Method: POST
    Route: breakdown
    Parameters:
        request (Request): The request options
    Response:
        GenericResponse<DatasetBreakdown>

Get Sources

    Method: GET
    Route: sources
    Parameters: none
        
    Response:
        GenericResponse<List<string>>

B) HealthController

Route: base URL

Health Check

    Method: GET
    Route: /
    Response:
        ImportantMessage: A message indicating the service health

C) ServiceController

Route: api/service

Start Service (From S3)

    Method: GET
    Route: initServiceFromS3
    Parameters:
        restart (bool, optional): Flag to indicate if the service should restart. Default is false.
    Response:
        GenericResponse<string>

Start Service From Local Folder

    Method: GET
    Route: initServiceFromLocalFolder
    Parameters:
        restart (bool, optional): Flag to indicate if the service should restart. Default is false.
    Response:
        GenericResponse<string>

Get Service Status

    Method: GET
    Route: status
    Response:
        GenericResponse<string>

Set Search Mode

    Method: GET
    Route: setMode
    Parameters:
        mode (int): Search mode (1: Low load, 2: Mid load, 3: High load)
    Response:
        IActionResult

Get Service Version

    Method: GET
    Route: version
    Response:
        Definitions.Version?

Request and Response Schemas

GenericResponse

Generic response structure, payload type T

{
  "success": "boolean",
  "payload": "T",
  "error": {
    "code": "string",
    "message": "string"
  },
  "version": {
    "dataTimestamp": "DateTime",
    "knowledgeGraphTimestamp": "DateTime",
    "systemVersion": "string"
  }
}

DatasetBreakdown

{
  "metadata": {
    "string": [
      "AttributeDefinition"
    ]
  },
  "products": [
    "Product"
  ]
}

Product

{
  "id": "string",
  "metadata": {
    "string": [
      "AttributeDefinition"
    ]
  },
  "features": {
    "string": [
      "string"
    ]
  },
  "baseHash": "string",
  "completeHash": "string"
}

ErrorClass

{
  "code": "string",
  "message": "string"
}

ImportantMessage

{
  "message": "string"
}

Version

{
  "dataTimestamp": "DateTime?",
  "knowledgeGraphTimestamp": "DateTime?",
  "systemVersion": "string"
}

AttributeDefinition

{
  "attributeName": "string",
  "children": {
    "string": [
      "AttributeDefinition"
    ]
  },
  "dataType": "string?",
  "values": [
    "string"
  ]
}

DatasetInformation

{
  "id": "int",
  "persistentID": "string",
  "baseHash": "string",
  "completeHash": "string",
  "metadata": {
    "string": [
      "AttributeDefinition"
    ]
  }
}

DatasetInformation

{
  "id": "int",
  "persistentID": "string",
  "baseHash": "string",
  "completeHash": "string",
  "metadata": {
    "string": [
      "AttributeDefinition"
    ]
  }
}

Request

{
  "DatasetId": "int?",
  "DatasetPersistentId": "string?",
  "FunctionalOptions": {
    "string": [
      "string"
    ]
  },
  "RequestOptions": {
    "string": [
      "string"
    ]
  }
}

QueryList

Generic list of type T

{
  "Items": [
	"T"
  ]
}

Examples

Example Request (Generate Download Script)

Request Body:

{
  "datasetId": 123,
  "datasetPersistentId": "abc123",
  "functionalOptions": {
    "option1": ["value1", "value2"]
  },
  "requestOptions": {
    "option2": ["value3"]
  }
}

Response:

{
  "success": true,
  "payload": "Generated script content",
  "error": null,
  "version": {
    "dataTimestamp": "2023-10-10T00:00:00",
    "knowledgeGraphTimestamp": "2023-10-10T00:00:00",
    "systemVersion": "1.0.0"
  }
}

Querying services

ADS/CDS

Script generation

Functional Options

DownloadOption: "Zip file (.zip)", "Compressed tar file(.tar.gz)", "GRIB2", "NetCDF (experimental)"

Request Options

Dataset-dependent options

ADAM

Dataset Breakdown

Request Options

Geometry, Date, ProductPrefix

Script generation

Functional Options

Compress: True, False

Request Options

ProductID

CMCC

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

All features (non-empty) discovered via the dataset breakdown "ProductID": selected product to be downloaded from (value found in dataset breakdown: Products array -> selected product -> metadata -> id "Geometry": same format as ADAM

DestinE

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

"Date": same format as ADAM "ProductID": selected product to be downloaded from (value found in dataset breakdown: Products array -> selected product -> metadata -> id AND All features discovered via the dataset breakdown under the selected product

Eumetsat

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

All features discovered via the dataset breakdown

Noaa

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

All features discovered via the dataset breakdown

Sentinel

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

"Geometry": same format as ADAM "Date": same format as ADAM

The constructed python script is currently an initial placeholder and will have to be refined.

Eumetsat

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

All features discovered via the dataset breakdown

Silam

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

All features discovered via the dataset breakdown (the email entry is empty, meaning the user can optioally type in their email)

Also, the following needs to be provided as well:

"Geometry": same format as ADAM "Date": same format as ADAM

Inspire

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

No customization needed. You always get the same script. Provide empty request parameters

Istat

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

All features discovered via the dataset breakdown

Land

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

"ProductID": available options found via the breakdown "Date": 2 dates for proper range

The constructed python script is currently an initial placeholder and will have to be refined.

Marine

Dataset Breakdown

Request Options

Script generation

Functional Options
Request Options

"Variable": available options found via the breakdown "Date": 2 dates for proper range

The constructed python script is currently an initial placeholder and will have to be refined.

Optional port forwarding

If you are running the service locally and want to access it from a remote machine, you can use kubectl port forwarding to forward the service port to your local machine. The following command can be used to forward the service port to your local machine:

kubectl port-forward -n kg-web-proto svc/kg-web-proto-service 8081:8080

Optionally, you can specify the kubeconfig file path if you are not using the default kubeconfig file:

kubectl port-forward -n kg-web-proto svc/kg-web-proto-service 8081:8080 --kubeconfig path\to\your\kubeconfig

About

EO4EU Knowledge Graph

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors