-
Notifications
You must be signed in to change notification settings - Fork 1
apisspec
galyfray edited this page Oct 14, 2021
·
21 revisions
- In any cases, all functions return a JSON with a field named
status
which value is set astrue
in case of success. The rest of the messages is specific to each service. - In case of failure returned messages are like
{status:false, error: {}}
. Theerror
content is specified in the JsonAdqlBuilder's page. - Table names can be given as qualified names (schema.table) or not (table)
- Table names are never returned as qualified names (schema.table) but always as simple table names
- The column descriptors (namely
Attribute_Handler
) always have the same structure{name, db_name, type, ucd, utype, description, range}
- Field description:
-
name
: Orginal name of the field -
db_name
: Field name as known by the DB. Must be used to set constraints -
type
: data abse type of the attribute (string, int...) -
ucd
: Unified Content Descriptor -
utype
: Model binding -
descriptor
: Text descriptor -
range
: Range of supported values:{min, max}
or[val1, val2...]
-
- Only
db_name
andtype
have always to be set. - If no name is given
name
takes thedn_name
value. - All fields must be in the response, even the not set ones.
-
Attribute_Handler
are managed by a specific JS class.
- Field description:
-
Async Method:
connect
-
Action:
- Connect the TAP service
- Get all meta data requested to build the JSON map
- Build the JSON map
-
Params: Dict with the following keys
{tapservice, schema, table}
-
tapservice
(string): URL of the TAP service -
schema
(string): Schema containing the complex object -
table
(string): Root table of the complex object
-
-
Return: A dictionary with the action status.
- Succes:
{status: true}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
disconnect
-
Action:
- Disconnect the TAP service
- Reset all stored data
- Params: None
-
Return: A dictionary with the action status.
- Succes:
{status: true}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
getConnector
-
Action:
- Returns the connection parameters
- Params: None
-
Return: A dictionary with the action status.
- Succes: Dict with the following keys
{status: true , service: {tapservice, schema, table}}
The table does not include the schema name. - Failure:
{status:false, error: {}}
- Succes: Dict with the following keys
-
Async Method:
getObjectMap
-
Action:
- Returns the JSON map of the current connection
- Params: None
-
Return: A dictionary with the action status.
- Succes:
{status: true , object_map: {object map}}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
getJoinedTables
-
Params:
-
baseTable
(string): Table from which joint table are searched
-
-
Action:
- Returns the list of the tables joined with
table
Iftable
is undefined, the root table is taken as base table.
- Returns the list of the tables joined with
-
Return: A dictionary with the searched tables.
All table names are returned as simple name (without the schema name)
- Succes:
{status: true , base_table: baseTable joined_tables: [table1, .....]}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
getRootQuery
-
Params:
- None
-
Action:
- Returns the ADQL query returning all the ids of the root table filtered by all constraints put on joined tables at any levels
-
Return: A dictionary with the searched tables.
All table names are returned as simple names (without the schema name)
- Succes:
{status: true, query: query}
- Failure:
{status:false, error: {}}
- Succes:
-
Async Method:
getRootQueryIds
-
Params:
- None
-
Action:
- Returns the ids returned by the ADQL query on the root table filtered by all constraints put on joined tables at any levels.
-
Return: A status with the id list.
- Succes:
{status: true, root_ids: [id1, id2...]}
- Failure:
{status:false, error: {}}
- Succes:
-
Async Method:
getRootFields
-
Params:
- None
-
Action:
- Returns all fields of root table rows returned by the ADQL query on the root table filtered by all constraints put on joined tables at any levels.
-
Return: A status with a list of field value arrays.
- Succes:
{status: true, field_values: [[field1, field2...],[field1, field2...]..]}
- Failure:
{status:false, error: {}}
- Succes:
-
Async Method:
getTableQuery
-
Params:
-
table
: string -
join_key
: any: join key value
-
-
Action:
- Returns the ADQL query returning all the selected fiedls of the table filtered by all constraints put on joined tables at any levels
- if no fields are selected then all know fields used in joins and a list of default fields build by the KT is used
-
Return:
- Succes:
{status: true, query: query}
- Failure:
{status:false, error: {}}
- Succes:
-
Async Method:
getTableSelectedField
-
Params:
-
table
: string -
join_key
: any: join key value
-
-
Action:
- Returns the selected fields values returned by the ADQL query on
table
filtered by all constraints put on joint tables at any levels. - if no fields are selected then all know fields used in joins and a list of default fields build by the KT is used
- Returns the selected fields values returned by the ADQL query on
-
Return: A status with an id list.
- Succes:
{status: true, field_values: [[field1, field2...],[field1, field2...]..]}
- Failure:
{status:failed, error: {}}
- Succes:
-
Async Method:
getTableFieldsQuery
-
Params:
-
table
: string -
join_key
: any: join key value
-
-
Action:
- Returns the ADQL query returning all the fiedls of the table filtered by all constraints put on joined tables at any levels
-
Return:
- Succes:
{status: true, query: query}
- Failure:
{status:false, error: {}}
- Succes:
-
Async Method:
getTableFields
-
Params:
-
table
: string -
join_key
: any: join key value
-
-
Action:
- Returns all fields of the table rows returned by the ADQL query on
table
filtered by all constraints put on joint tables at any levels.
- Returns all fields of the table rows returned by the ADQL query on
-
Return: A status with a list of field value arrays.
- Succes:
{status: true, field_values: [[field1, field2...],[field1, field2...]..]}
- Failure:
{status:false, error: {}}
- Succes:
-
Async Method:
getTableAttributeHandlers
-
Params:
-
table
: string
-
-
Action:
- Returns the
table
attribute handlers.
- Returns the
-
Return: A status with a list of AttributeHandlers.
- Succes:
{status: true, attribute_handlers: [{AH1, {AH2}...]}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
setTableConstraint
-
Params:
-
table
: string : table on which the constraint is set (root table if undefined) -
constraint
: string : ADQ constraint (to be put after a WHERE: no aggregation)
-
-
Action:
- Writes the constraint at he right place in the object map.
-
Return: the operation status.
- Succes:
{status: true}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
resetTableConstraint
-
Params:
-
table
: string : table on which the constraint is reset (root table if undefined)
-
-
Action:
- Removes the
table
constraints from the object map.
- Removes the
-
Return: the operation status.
- Succes:
{status: true}
- Failure:
{status:false, error: {}}
- Succes:
-
Method:
resetAllTableConstraint
- Params: None
-
Action:
- Removes all constraints on the object map.
-
Return: the operation status.
- Succes:
{status: true}
- Failure:
{status:false, error: {}}
- Succes: