Virtualize API (0.9.0)

Download OpenAPI specification:

"Moving" data access, Virtualizes data access to underlying persistence engines.

Version

Return current version of data virt

Responses

Response samples

Content type
application/json
{
  • "applicationVersion": "0.4.8\"",
  • "chartVersion": "0.4.8"
}

Data Source

Proxy for getting dataset, dataset version or a named query from its id.

Authorizations:
oidc
path Parameters
dataSourceId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...

Responses

Response samples

Content type
application/json
Example
{
  • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "type": "DATASET_VERSION",
  • "oClass": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Proxy for getting items from dataset, dataset version or named query.

Get 200 items from data source. It's possible to filter, and set more than one filter in query parameters.

Authorizations:
oidc
path Parameters
dataSourceId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
query Parameters
filter
string{{attribute_id}},{{OPERATOR}},{{value}},{{upp...
Example: filter=uuid,INSIDE,2020,2022

Query parameter usage of FilterDto. The upperValue is necessary only with operator that accept it such as INSIDE and OUTSIDE.

limit
integer <int32> (Limit) <= 1000
Default: 200
Example: limit=10
object{{is_sort_id}},{{attribute_id}},{{direction}}...
Example: order=uuid,desc,METADATA&order=true,asc

Query parameters usage to SortDto.

excludeGeo
boolean (ExcludeGeo)
Default: true

Parameter to exclude geographic data from queries.

withSourceItems
boolean (WithSourceItems)
Default: false

Parameter to include source items from relations in search result.

withDestinationItems
boolean (WithDestinationItems)
Default: false

Parameter to include destination items from relations in search result.

Responses

Response samples

Content type
application/json
{
  • "items": {
    },
  • "relations": [ ],
  • "count": {
    },
  • "searchAfter": null
}

Proxy for getting items from dataset, dataset version or named query.

Get 200 items from data source.

It is possible to search on one or more classes. On Mono class search, it returns items from all active datasets. It's possible to specify dataset versions ids. 200 items are returned. This limit can be adjusted, but cannot exceed 1000. Items can be sorted. Works only with a Mono Class search. If a sort is set, then the next page of results can be retrieved by specifying the "searchAfter" value of the first search result. This property has a ttl: once the time has elapsed, you'll have to restart the search from the beginning. It's also possible to add one or more filters in query parameters and sort your results.

Authorizations:
oidc
path Parameters
dataSourceId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
query Parameters
filter
string{{attribute_id}},{{OPERATOR}},{{value}},{{upp...
Example: filter=uuid,INSIDE,2020,2022

Query parameter usage of FilterDto. The upperValue is necessary only with operator that accept it such as INSIDE and OUTSIDE.

object{{is_sort_id}},{{attribute_id}},{{direction}}...
Example: order=uuid,desc,METADATA&order=true,asc

Query parameters usage to SortDto.

Request Body schema: application/json
oClass
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
datasetVersionIds
Array of strings <uuid> (UUID) [ items <uuid >[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-... ]
any (ConditionDto)
object (SortDto)
searchAfter
string or null
type
string (SearchRequestType)
object (FullSearchConditionDto)
limit
integer <int32> (Limit) <= 1000
Default: 200
excludeGeo
boolean (ExcludeGeo)
Default: true

Parameter to exclude geographic data from queries.

withSourceItems
boolean (WithSourceItems)
Default: false

Parameter to include source items from relations in search result.

withDestinationItems
boolean (WithDestinationItems)
Default: false

Parameter to include destination items from relations in search result.

object (RelationDto)

Responses

Request samples

Content type
application/json
Example

Returns items from oclass oclass_id_1.

{
  • "type": "MONO_CLASS",
  • "oClass": "23fee6a5-5edc-4b37-a74c-47d8022e81b4"
}

Response samples

Content type
application/json
{
  • "items": {
    },
  • "relations": [ ],
  • "count": {
    },
  • "searchAfter": null
}

Get aggregated results from dataset, dataset version or named query.

Named query must reference a mono class request. Only aggregatedBy is required. The default operation is count.

Authorizations:
oidc
path Parameters
dataSourceId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
query Parameters
aggregatedBy
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
Example: aggregatedBy=tree_AttributeId
dateInterval
string (DateInterval)
Enum: "SECOND" "MINUTE" "HOUR" "WEEK" "QUARTER" "YEAR"
Examples:
  • dateInterval=null -
  • dateInterval=null -
  • dateInterval=null -
filter
string{{attribute_id}},{{OPERATOR}},{{value}},{{upp...
Example: filter=uuid,INSIDE,2020,2022

Query parameter usage of FilterDto. The upperValue is necessary only with operator that accept it such as INSIDE and OUTSIDE.

groupBy
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
Examples:
  • groupBy=null -
  • groupBy=year_AttributeId -
  • groupBy=null -
interval
number <double>
Examples:
  • interval=null -
  • interval=null -
  • interval=10 -
operation
string (AggregateOperation)
Enum: "count" "max" "min" "avg" "sum" "cardinality" "median" "q1" "q3" "extent"
Examples:
  • operation=count -
  • operation=sum -
  • operation=sum -
object

Query parameter usage to SortAggregate.

valueField
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
Examples:
  • valueField=null -
  • valueField=area_attributeId -
  • valueField=area_AttributeId -
excludeGeo
boolean (ExcludeGeo)
Default: true

Parameter to exclude geographic data from queries.

limit
integer <int32> (Limit) <= 1000
Default: 200
Example: limit=10

Responses

Response samples

Content type
application/json
Example

aggregation with only aggregatedBy. Return the count of each trees.

{
  • "operation": "count",
  • "values": [
    ]
}

Get distinct values on attribute column where value match a requested value

This endpoint is used to retrieve a list of possible values for an attribute in a datasource. The datasource available for this endpoint are Dataset and DatasetVersion

Authorizations:
oidc
query Parameters
filter
string{{attribute_id}},{{OPERATOR}},{{value}},{{upp...
Example: filter=uuid,INSIDE,2020,2022

Query parameter usage of FilterDto. The upperValue is necessary only with operator that accept it such as INSIDE and OUTSIDE.

Request Body schema: application/json
Array
value
string
limit
integer <int32> (Limit) <= 1000
Default: 200
Array of objects (AttributeByDatasource)

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • "marie",
  • "marianne",
  • "marin"
]

Dataset

Trigger asynchronous items insertion

Import data by adding ItemDto list directly in a new version of a closed dataset

Authorizations:
oidc
path Parameters
datasetId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...

Dataset id

id
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...

Dataset version id that will be created

Request Body schema: application/json
Array
id
string
oClass
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
object
object
datasetVersionId
string
itemId
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "application": "data-virt",
  • "code": "BAD_REQUEST",
  • "message": "Item {{item_id}} cannot be added due to different OClassId with its Dataset"
}

File

Upload file

Save file which will be linked to an item

Authorizations:
oidc
Request Body schema: multipart/form-data
file
string <binary>
filename
string

Name of the file (unique identifier). If filename is not sent, file identifier is generated with random UUID (returned is response).

Responses

Response samples

Content type
application/json
{
  • "application": "data-virt",
  • "code": "BAD_REQUEST",
  • "message": "File is required."
}

Download file

Download file linked to an item by using the id generated during the upload. It's possible to retrieve part of the file by specifying the range in headers.

Authorizations:
oidc
path Parameters
id
required
string

File id

header Parameters
Range
string
Example: bytes=440000-882069

Responses

Response samples

Content type
No sample

Upload icon or illustration

Service used for saving an icon for oClass customization or an illustration for widget and dashboard.

Authorizations:
oidc
query Parameters
type
object
Enum: "icon" "illustration"
Example: type=icon

Image category

Request Body schema:
file
string <binary>

Responses

Response samples

Content type
application/json
Example
{
  • "application": "data-virt",
  • "code": "BAD_REQUEST",
  • "message": "Type is required."
}

Get all icons and illustrations names

Return the name of all uploaded icons and illustrations, with their corresponding type. It's possible to filter on type to get all icons or all illustrations.

Authorizations:
oidc
query Parameters
type
object
Enum: "icon" "illustration"
Example: type=icon

Image type

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Download icon or illustration

Download the icon or illustration by using the id generated during the upload

Authorizations:
oidc
path Parameters
name
required
string

Icon or illustration id

Responses

Response samples

Content type
application/json
{
  • "code": 404,
  • "message": "Entity : ac2c1a7f-0694-4f03-bb00-d349adeecd3d inexistant."
}

Delete icon or illustration

This endpoint is only used for cleaning s3 server.

Authorizations:
oidc
path Parameters
name
required
string

Icon or illustration id

Responses

Response samples

Content type
application/json
{
  • "code": 404,
  • "message": "Entity : ac2c1a7f-0694-4f03-bb00-d349adeecd3d inexistant."
}

Set type to an icon or illustration

Type is necessary when uploading an icon or illustration, but it's possible to add a additional types with this endpoint.

Authorizations:
oidc
path Parameters
id
required
string

Icon or illustration id

type
required
string

type to add

Responses

Response samples

Content type
application/json
{
  • "application": "data-virt",
  • "code": "BAD_REQUEST",
  • "message": "Type {{type}} already exists for file {{file_id}}"
}

Imports

Asynchronous data import

Asynchronous data import that support csv file and zipped shapefile. It returns the created dataset version for dataset. NormalizeGeo is used to specify whether a shapefile should be normalized. For example, if a shapefile contains a polygon and a multi-polygon, set this property to true. ChunkSize is used to specify the number of items per chunk that data-virt will hold in memory during import.

Authorizations:
oidc
path Parameters
datasetId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...

Dataset id

Request Body schema:
file
string <binary>
normalizeGeo
boolean
Default: false
chunkSize
integer
object (DatasetVersionInformationDto)

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "dataset": {
    },
  • "oClass": "04c4759f-4d1b-48af-be42-deac3d5dca7a",
  • "lastModified": "2022-03-10T16:15:50Z",
  • "version": 2,
  • "state": "LOADING",
  • "withFile": false,
  • "metadata": [
    ],
  • "hasWarnings": false
}

Items

Synchronous insertion (or update) of ItemDto collection

Adds (or updates) items in the dataset version of an open or modifiable dataset. The updateMode parameter is optional, used only for updating items that are already known. It can be set to :

  • REPLACE : previously existing item is fully replaced with new content as delete and insert
  • MERGE : previously existing item is merged with new content
Authorizations:
oidc
query Parameters
updateMode
string (ItemUpdateMode)
Enum: "REPLACE" "MERGE"

Mode of update operation

Request Body schema: application/json
Array
id
string
oClass
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
object
object
datasetVersionId
string
itemId
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Return item

Authorizations:
oidc
path Parameters
required
object (ItemId)

Item id

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "oClass": "04c4759f-4d1b-48af-be42-deac3d5dca7a",
  • "metadata": {
    },
  • "attributes": {
    },
  • "datasetVersionId": "string",
  • "itemId": "string"
}

Return all items related to the requested item

Authorizations:
oidc
path Parameters
required
object (ItemId)

Item id

Responses

Response samples

Content type
application/json
{
  • "items": {
    },
  • "relations": [
    ],
  • "count": {
    },
  • "searchAfter": "string",
  • "geoFormat": "GEO_JSON",
  • "sourceItems": {
    },
  • "destinationItems": {
    }
}

Metadata

Add metadata on specific attribute on specific item

Authorizations:
oidc
path Parameters
required
object (ItemId)

Item id

attributeName
required
string

Attribute name

metadataName
required
string

Metadata name

value
required
string

Metadata value

Responses

Response samples

Content type
application/json
{
  • "application": "data-virt",
  • "code": "BAD_REQUEST",
  • "message": "Unknown metadata {{metadata_name}}"
}

Add metadata on specific item

Authorizations:
oidc
path Parameters
required
object (ItemId)

id de l'item

metadataName
required
string

metadata name

value
required
string

metadata value

Responses

Response samples

Content type
application/json
{
  • "application": "data-virt",
  • "code": "BAD_REQUEST",
  • "message": "Unknown metadata {{metadata_name}}"
}

Search

Returns items that match named query

Search criteria are stored in a named query. It's possible to add a limit and a order like the classic search.

Authorizations:
oidc
path Parameters
nameQueryId
required
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...

named query id

query Parameters
limit
integer <int32> (Limit) <= 1000
Default: 200
Example: limit=10
object{{is_sort_id}},{{attribute_id}},{{direction}}...
Example: order=uuid,desc,METADATA&order=true,asc

Query parameters usage to SortDto.

Responses

Response samples

Content type
application/json
Example
{
  • "items": {
    },
  • "relations": [ ],
  • "count": {
    },
  • "searchAfter": null
}

Relations

Save a list of relations

Registers a relation between two attributes of different oClasses to link items of these oClasses. It creates a new item in the relation index in elasticsearch. The relationType must first be registered in data-ref service.

Authorizations:
oidc
Request Body schema: application/json
Array
relationType
string
source
string
destination
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Delete relation between two attributes

Deleting a relation implies the dissociation between items linked by the relation.

Authorizations:
oidc
Request Body schema: application/json
relationType
string
source
string
destination
string

Responses

Request samples

Content type
application/json
{
  • "relationType": "string",
  • "source": "string",
  • "destination": "string"
}

Relation Aggregate

Update relations between items. Called by `data-link`

Data Link automatically analyze which relation is deprecated, and update them by calling this endpoint with the aggregateId and the link which is the id of the attribute on which to delete and remake the relation.

Authorizations:
oidc
Request Body schema: application/json
Array
link
string <uuid> (UUID) [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-...
aggregateId
string
source
Array of strings
dest
Array of strings

Responses

Request samples

Content type
application/json
[
  • {
    }
]