MDM
On Demand Tables
Function: on_demand_tables Type: API Endpoint (POST)
Purpose: This endpoint facilitates the creation and management of tables in the customer database. It allows for the creation, alteration, and deletion of columns within a custom table based on the provided request data.
URL: POST /api/mdm/on_demand_tables
Request Parameters:
- request (Request): The request object.
- table_request (TableCreateRequest): An object containing details about the table and columns to be managed.
- Customer_Key (Header, required): A base64 encoded string containing lscode and firmcode.
- current_user (str): The current user performing the operation, obtained via dependency injection.
Process:
- Decodes the Customer_Key to extract lscode and firmcode.
- Checks if the table exists in the metadata (LS_Custom_Tables). If not, it inserts a new entry.
- Iterates over the columns in table_request to perform create, alter, or drop operations:
- Creates a new column if it doesn't exist.
- Alters an existing column's details.
- Drops a column if specified.
- Constructs and executes a SQL query to create the actual database table based on the processed metadata.
- Commits the transaction and returns a response detailing the status of the operations.
Response:
- A JSON object containing a status message and details of each column operation performed.
- Indicates success or failure for each step, including any errors encountered.
Exceptions:
- Handles exceptions related to database operations and invalid customer key formats, providing appropriate error messages.
post/api/mdm/on_demand_tables
Request
- Base URLhttps://api.leapsurgebi.com (the document declares no server; this is the origin it was published from)
- AuthOAuth 2PasswordToken URL/auth/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Customer-Keystring required
Request body
Response
Successful Response
unknown required
Changes
No recorded changes to this operation across all 3 revisions of this API.