MDM NEW
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/new_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/new_mdm/on_demand_tables
Query parameters
flagstring
Headers
Customer-Keystring required
User-Codestring required
Request body
Response
Successful Response
{"stackTrail":"paths:/api/new_mdm/on_demand_tables:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}
Changes
No recorded changes to this endpoint across all 1 revision of this API.