Skip to content

Найти само API можно по ссылкам:

HyperLeda API specification 1.0.0#

table#


POST /admin/api/v1/table/data#

Add new raw 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
TokenAuth header string N/A No JWT Bearer token

Request body

{
    "table_id": 0,
    "data": [
        {
            "name": "M 33",
            "ra": 1.5641,
            "dec": 30.6602
        },
        {
            "name": "M 31",
            "ra": 0.7123,
            "dec": 41.269
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "table_id": {
            "type": "integer",
            "description": "ID of the table to add data to"
        },
        "data": {
            "type": "array",
            "description": "Actual data to append. \n                Keys in this dictionary must be a subset of the columns in the table. \n                If not specified, column will be set to NULL.\n\n                NaN and NULL are considered to be the same thing.",
            "example": [
                {
                    "name": "M 33",
                    "ra": 1.5641,
                    "dec": 30.6602
                },
                {
                    "name": "M 31",
                    "ra": 0.7123,
                    "dec": 41.269
                }
            ],
            "items": {
                "type": "object",
                "additionalProperties": {}
            }
        }
    },
    "required": [
        "data",
        "table_id"
    ]
}

Response 200 OK

{
    "data": {}
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/AddDataResponseSchema"
        }
    }
}

POST /admin/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
TokenAuth header string N/A No JWT Bearer token

Request body

{
    "table_name": "string",
    "columns": [
        {
            "name": "name",
            "data_type": "str",
            "ucd": "meta.id"
        },
        {
            "name": "ra",
            "data_type": "float",
            "unit": "hourangle",
            "ucd": "pos.eq.ra"
        },
        {
            "name": "dec",
            "data_type": "float",
            "unit": "deg",
            "ucd": "pos.eq.dec"
        }
    ],
    "bibcode": "2024PDU....4601628D",
    "datatype": "regular",
    "description": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "table_name": {
            "type": "string",
            "description": "Name of the table"
        },
        "columns": {
            "type": "array",
            "description": "List of columns in the table",
            "example": [
                {
                    "name": "name",
                    "data_type": "str",
                    "ucd": "meta.id"
                },
                {
                    "name": "ra",
                    "data_type": "float",
                    "unit": "hourangle",
                    "ucd": "pos.eq.ra"
                },
                {
                    "name": "dec",
                    "data_type": "float",
                    "unit": "deg",
                    "ucd": "pos.eq.dec"
                }
            ],
            "items": {
                "$ref": "#/components/schemas/ColumnDescription"
            }
        },
        "bibcode": {
            "type": "string",
            "description": "ADS bibcode of the article that published the data (or code of the internal communication)",
            "example": "2024PDU....4601628D"
        },
        "datatype": {
            "type": "string",
            "default": "regular",
            "enum": [
                "regular",
                "reprocessing",
                "preliminary",
                "compilation",
                null
            ],
            "description": "Type of the data in the table",
            "nullable": true
        },
        "description": {
            "type": "string",
            "default": "",
            "description": "Human-readable description of the table",
            "nullable": true
        }
    },
    "required": [
        "bibcode",
        "columns",
        "table_name"
    ]
}

Response 200 OK

{
    "data": {
        "id": 0
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/CreateTableResponseSchema"
        }
    }
}

Response 201 Created

{
    "data": {
        "id": 0
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/CreateTableResponseSchema"
        }
    }
}

PATCH /admin/api/v1/table#

Patch table schema

Description

Patch the schema of the table, including column UCDs and units.

Request body

{
    "table_name": "string",
    "actions": [
        {}
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "table_name": {
            "type": "string",
            "description": "Name of the table"
        },
        "actions": {
            "type": "array",
            "description": "List of actions to perform",
            "items": {
                "$ref": "#/components/schemas/PatchTableAction"
            }
        }
    },
    "required": [
        "actions",
        "table_name"
    ]
}

Response 200 OK

{
    "data": {}
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/PatchTableResponseSchema"
        }
    }
}

GET /admin/api/v1/table/validation#

Validate table schema

Description

Validates the schema of the table, including column units and UCDs.

Returns code 200 even if there are validation errors.

Input parameters

Parameter In Type Default Nullable Description
table_name query string No Name of the table

Response 200 OK

{
    "data": {
        "validations": [
            {
                "message": "string",
                "validator": "string"
            }
        ]
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/GetTableValidationResponseSchema"
        }
    }
}

GET /admin/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
TokenAuth header string N/A No JWT Bearer token
table_id query integer No Identifier of the table

Response 200 OK

{
    "data": {
        "processing": {}
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/TableStatusStatsResponseSchema"
        }
    }
}

POST /admin/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:

{
    "name": "designation",
    "parameters": {
        "design": {
            "column_name": "object_name"
        }
    }
}

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:

{
    "name": "icrs",
    "parameters": {
        "ra": {
            "column_name": "RAJ2000"
        },
        "dec": {
            "column_name": "DEJ2000"
        }
    },
    "additional_params": {
        "e_ra": 0.1,
        "e_dec": 0.5
    }
}

Input parameters

Parameter In Type Default Nullable Description
TokenAuth header string N/A No JWT Bearer token

Request body

{
    "table_name": "string",
    "catalogs": [
        {
            "name": "icrs",
            "parameters": {
                "ra": {
                    "column_name": "ra"
                },
                "dec": {
                    "column_name": "dec"
                }
            },
            "key": "string",
            "additional_params": {
                "e_ra": 0.1,
                "e_dec": 0.2
            }
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "table_name": {
            "type": "string",
            "description": "Table to which apply the marking rules to."
        },
        "catalogs": {
            "type": "array",
            "minItems": 1,
            "items": {
                "$ref": "#/components/schemas/Catalog"
            }
        }
    },
    "required": [
        "catalogs",
        "table_name"
    ]
}

Response 200 OK

{
    "data": {}
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/CreateMarkingResponseSchema"
        }
    }
}

source#


POST /admin/api/v1/source#

New source entry

Description

Creates new source entry in the database for internal communication and unpublished articles.

Input parameters

Parameter In Type Default Nullable Description
TokenAuth header string N/A No JWT Bearer token

Request body

{
    "title": "string",
    "authors": [
        "string"
    ],
    "year": 2006
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "title": {
            "type": "string",
            "description": "Title of publication"
        },
        "authors": {
            "type": "array",
            "description": "List of authors",
            "items": {
                "type": "string"
            }
        },
        "year": {
            "type": "integer",
            "minimum": 1500,
            "description": "Year of the publication",
            "example": 2006
        }
    },
    "required": [
        "authors",
        "title",
        "year"
    ]
}

Response 200 OK

{
    "data": {
        "code": "string"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/CreateSourceResponseSchema"
        }
    }
}

tasks#


GET /admin/api/v1/task#

Get information about the task

Description

Retrieves information about the task using its id.

Input parameters

Parameter In Type Default Nullable Description
TokenAuth header string N/A No JWT Bearer token
task_id query integer No ID of the task

Response 200 OK

{
    "data": {
        "id": 0,
        "task_name": "string",
        "status": "string",
        "payload": {},
        "start_time": "2022-04-13T15:42:05.901Z",
        "end_time": "2022-04-13T15:42:05.901Z",
        "message": {}
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/GetTaskInfoResponseSchema"
        }
    }
}

authentication#


POST /admin/api/v1/login#

Login user with username and password

Description

Gives user credentials for authentication in handlers

Request body

{
    "username": "string",
    "password": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "username": {
            "type": "string"
        },
        "password": {
            "type": "string"
        }
    },
    "required": [
        "password",
        "username"
    ]
}

Response 200 OK

{
    "data": {
        "token": "string"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "data": {
            "$ref": "#/components/schemas/LoginResponseSchema"
        }
    }
}

Schemas#

AddDataRequestSchema#

Name Type
data Array<>
table_id integer

AddDataResponseSchema#

Catalog#

Name Type
additional_params Example: {'e_ra': 0.1, 'e_dec': 0.2}
key string
name string
parameters Example: {'ra': {'column_name': 'ra'}, 'dec': {'column_name': 'dec'}}

ColumnDescription#

Name Type
data_type string
description string| null
name string
ucd string| null
unit string| null

CreateMarkingRequestSchema#

Name Type
catalogs Array<Catalog>
table_name string

CreateMarkingResponseSchema#

CreateSourceRequestSchema#

Name Type
authors Array<string>
title string
year integer

CreateSourceResponseSchema#

Name Type
code string

CreateTableRequestSchema#

Name Type
bibcode string
columns Array<ColumnDescription>
datatype string| null
description string| null
table_name string

CreateTableResponseSchema#

Name Type
id integer

GetTableValidationRequestSchema#

Name Type
table_name string

GetTableValidationResponseSchema#

Name Type
validations Array<TableValidation>

GetTaskInfoRequestSchema#

Name Type
task_id integer

GetTaskInfoResponseSchema#

Name Type
end_time string(date-time)
id integer
message
payload
start_time string(date-time)
status string
task_name string

LoginRequestSchema#

Name Type
password string
username string

LoginResponseSchema#

Name Type
token string

Parameter#

Name Type
column_name string
enrichment

PatchTableAction#

PatchTableRequestSchema#

Name Type
actions Array<PatchTableAction>
table_name string

PatchTableResponseSchema#

TableStatusStatsRequestSchema#

Name Type
table_id integer

TableStatusStatsResponseSchema#

Name Type
processing

TableValidation#

Name Type
message string
validator string

Security schemes#

Name Type Scheme Description
TokenAuth http bearer