Найти само API можно по ссылкам:
- Тестовое окружение: http://89.169.133.242/admin/api/docs
- Пользовательское окружение: http://dm2.sao.ru:81/admin/api/docs
HyperLEDA API 0.1.0#
Endpoints#
POST /api/v1/table/data#
Add new data to the table
Description
Inserts new data to the table. Deduplicates rows based on their contents. If two rows were identical this method will only insert the last one.
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
APIKeyHeader |
header | string | N/A | No | API key |
Request body
Schema of the request body
{
"properties": {
"table_id": {
"type": "integer",
"title": "Table Id"
},
"data": {
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"title": "Data",
"description": "Actual data to append. \nKeys in this dictionary must be a subset of the columns in the table. If not specified, column will be set to NULL.\nNaN and NULL are considered to be the same thing.",
"examples": [
[
{
"dec": 41.269,
"name": "M 31",
"ra": 0.7123
},
{
"dec": 30.6602,
"name": "M 33",
"ra": 1.5641
}
]
]
}
},
"type": "object",
"required": [
"table_id",
"data"
],
"title": "AddDataRequest"
}
Response 200 OK
Response 422 Unprocessable Content
POST /api/v1/source#
New internal source entry
Description
Creates new source entry in the database for internal communication and unpublished articles.
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
APIKeyHeader |
header | string | N/A | No | API key |
Request body
Schema of the request body
{
"properties": {
"title": {
"type": "string",
"title": "Title"
},
"authors": {
"items": {
"type": "string"
},
"type": "array",
"title": "Authors",
"examples": [
[
"Ivanov V.",
"Johnson H."
]
]
},
"year": {
"type": "integer",
"title": "Year",
"examples": [
2006
]
}
},
"type": "object",
"required": [
"title",
"authors",
"year"
],
"title": "CreateSourceRequest"
}
Response 200 OK
Response 422 Unprocessable Content
POST /api/v1/table#
Get or create schema for the table.
Description
Creates new schema for the table which can later be used to upload data. Important: If the table with the specified name already exists, does nothing and returns ID of the previously created table without any alterations.
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
APIKeyHeader |
header | string | N/A | No | API key |
Request body
{
"table_name": "string",
"columns": [
{
"name": "string",
"data_type": "str",
"ucd": null,
"unit": null,
"description": null
}
],
"bibcode": "string",
"datatype": "regular",
"description": "string"
}
Schema of the request body
{
"properties": {
"table_name": {
"type": "string",
"title": "Table Name"
},
"columns": {
"items": {
"$ref": "#/components/schemas/ColumnDescription"
},
"type": "array",
"title": "Columns",
"description": "List of columns in the table",
"examples": [
[
{
"data_type": "str",
"name": "name",
"ucd": "meta.id"
},
{
"data_type": "float",
"name": "ra",
"ucd": "pos.eq.ra",
"unit": "hourangle"
},
{
"data_type": "float",
"name": "dec",
"ucd": "pos.eq.dec",
"unit": "deg"
}
]
]
},
"bibcode": {
"type": "string",
"title": "Bibcode",
"description": "ADS bibcode of the article that published the data (or code of the internal communication)",
"examples": [
"2024PDU....4601628D"
]
},
"datatype": {
"$ref": "#/components/schemas/DataType"
},
"description": {
"type": "string",
"title": "Description",
"description": "Human-readable description of the table"
}
},
"type": "object",
"required": [
"table_name",
"columns",
"bibcode",
"datatype",
"description"
],
"title": "CreateTableRequest"
}
Response 200 OK
Response 422 Unprocessable Content
GET /api/v1/table#
Retrieve table information
Description
Fetches details about a specific table using the provided table name
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
table_name |
query | string | No |
Response 200 OK
{
"data": {
"id": 0,
"description": "string",
"column_info": [
{
"name": "string",
"data_type": "str",
"ucd": null,
"unit": null,
"description": null
}
],
"rows_num": 0,
"meta": {},
"bibliography": {
"title": "string",
"authors": [
"string"
],
"year": 0,
"bibcode": "string"
},
"marking_rules": [
{
"catalog": "string",
"key": "string",
"columns": {}
}
]
}
}
Response 422 Unprocessable Content
PATCH /api/v1/table#
Patch table schema
Description
Patch the schema of the table, including column UCDs and units.
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
APIKeyHeader |
header | string | N/A | No | API key |
Request body
Schema of the request body
{
"properties": {
"table_name": {
"type": "string",
"title": "Table Name"
},
"actions": {
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/PatchTableActionTypeChangeUCD"
},
{
"$ref": "#/components/schemas/PatchTableActionTypeChangeUnit"
}
]
},
"type": "array",
"title": "Actions"
}
},
"type": "object",
"required": [
"table_name",
"actions"
],
"title": "PatchTableRequest"
}
Response 200 OK
Response 422 Unprocessable Content
POST /api/v1/login#
Login
Description
Authenticates user and returns token
Request body
Response 200 OK
Response 422 Unprocessable Content
GET /api/v1/table/status/stats#
Get statistics on table processing
Description
Accesses the current status of the processing of a given table. Returns the distribution of objects by processing status. If there are no objects with the given status, it will not be present in the response.
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
table_id |
query | integer | No |
Response 200 OK
Response 422 Unprocessable Content
POST /api/v1/marking#
New marking rules for the table
Description
Creates new marking rules to map the columns in the table to catalog parameters. For a given table a marking would consist of the mapping between catalog parameters and the columns from the original table.
For example, if one wants to create a marking for a column object_name
that designates the name of an object,
they should create a catalog entry similar to the following:
Here, name
respresents the name of the catalog, keys of parameters
map
are parameter names and column_name
values are actual names of the columns under question. For now, only one
column per parameter is supported.
It is possible to create several catalog entries for a single object, for example - is there are two columns that represent a name of an object. In that case we might want to upload both names to the database so it is easier to cross-identify and search these objects later. Another use case might be if there are several columns that represent photometric information in different filters. In that case one might want to create one entry for each of the magnitude columns.
In that case you can specify several entries into rules
list with
different values of key
. For example:
{
"table_name": "my_table",
"rules": [
{
"name": "designation",
"parameters": {
"design": {
"column_name": "object_name"
}
},
"key": "primary_name"
},
{
"name": "designation",
"parameters": {
"design": {
"column_name": "secondary_object_name"
}
},
"key": "secondary_name"
}
]
}
The result of this would be two entries into the designation
catalog for
each object in the original table.
This handler also supports additional parameters that are not present in the
original table. For example, a
table might not have a separate column for astrometric errors but from other
sources you know that its error is
0.1 degrees for right ascension and 0.5 degrees for declination. You can
specify this in the
additional_params
field for each catalog:
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
APIKeyHeader |
header | string | N/A | No | API key |
Request body
Response 200 OK
Response 422 Unprocessable Content
GET /ping#
Check that service is up and running
Response 200 OK
Schemas#
AddDataRequest#
Name | Type |
---|---|
data |
Array<> |
table_id |
integer |
AddDataResponse#
APIOkResponse_AddDataResponse_#
Name | Type |
---|---|
data |
AddDataResponse |
APIOkResponse_CreateMarkingResponse_#
Name | Type |
---|---|
data |
CreateMarkingResponse |
APIOkResponse_CreateSourceResponse_#
Name | Type |
---|---|
data |
CreateSourceResponse |
APIOkResponse_CreateTableResponse_#
Name | Type |
---|---|
data |
CreateTableResponse |
APIOkResponse_GetTableResponse_#
Name | Type |
---|---|
data |
GetTableResponse |
APIOkResponse_LoginResponse_#
Name | Type |
---|---|
data |
LoginResponse |
APIOkResponse_PatchTableResponse_#
Name | Type |
---|---|
data |
PatchTableResponse |
APIOkResponse_TableStatusStatsResponse_#
Name | Type |
---|---|
data |
TableStatusStatsResponse |
Bibliography#
Name | Type |
---|---|
authors |
Array<string> |
bibcode |
string |
title |
string |
year |
integer |
CatalogToMark#
Name | Type |
---|---|
additional_params |
|
key |
|
name |
string |
parameters |
ColumnDescription#
Name | Type |
---|---|
data_type |
DatatypeEnum |
description |
|
name |
string |
ucd |
|
unit |
CreateMarkingRequest#
Name | Type |
---|---|
catalogs |
Array<CatalogToMark> |
table_name |
string |
CreateMarkingResponse#
CreateSourceRequest#
Name | Type |
---|---|
authors |
Array<string> |
title |
string |
year |
integer |
CreateSourceResponse#
Name | Type |
---|---|
code |
string |
CreateTableRequest#
Name | Type |
---|---|
bibcode |
string |
columns |
Array<ColumnDescription> |
datatype |
DataType |
description |
string |
table_name |
string |
CreateTableResponse#
Name | Type |
---|---|
id |
integer |
DataType#
Type: string
DatatypeEnum#
Type: string
GetTableResponse#
Name | Type |
---|---|
bibliography |
Bibliography |
column_info |
Array<ColumnDescription> |
description |
string |
id |
integer |
marking_rules |
Array<MarkingRule> |
meta |
|
rows_num |
integer |
HTTPValidationError#
Name | Type |
---|---|
detail |
Array<ValidationError> |
LoginRequest#
Name | Type |
---|---|
password |
string |
username |
string |
LoginResponse#
Name | Type |
---|---|
token |
string |
MarkingRule#
Name | Type |
---|---|
catalog |
string |
columns |
|
key |
string |
ObjectCrossmatchStatus#
Type: string
ParameterToMark#
Name | Type |
---|---|
column_name |
string |
PatchTableActionTypeChangeUCD#
Name | Type |
---|---|
column |
string |
ucd |
string |
PatchTableActionTypeChangeUnit#
Name | Type |
---|---|
column |
string |
unit |
string |
PatchTableRequest#
Name | Type |
---|---|
actions |
Array<> |
table_name |
string |
PatchTableResponse#
TableStatusStatsResponse#
Name | Type |
---|---|
processing |
ValidationError#
Name | Type |
---|---|
loc |
Array<> |
msg |
string |
type |
string |
Security schemes#
Name | Type | Scheme | Description |
---|---|---|---|
APIKeyHeader | apiKey |