majin1102 commented on issue #3139:
URL: https://github.com/apache/amoro/issues/3139#issuecomment-2323948195

   Two interfaces to be added:
   ---
   
   ## Retrieve All Available Actions
   **GET** `/action`
   
   ### Description
   This endpoint is used to fetch all available action types in the system. 
These action types include but are not limited to `minor`, `major`, `clean`, 
etc.
   
   ### Successful Response
   - **Code**: 200 OK
   - **Content Example**:
     ```json
     [
       "minor",
       "major",
       "clean"
     ]
     ```
   
   ### Error Response
   - **Code**: 500 Internal Server Error
     Returned when there is a server error and the list of actions cannot be 
retrieved.
   
   ---
   
   ## Get All Active Processes for a Specific Table
   **GET** `/optimizerGroups/{optimizerGroup}/{tableId}/processes`
   
   ### Description
   This endpoint retrieves information about all active processes for a 
specified optimizer group and table ID. Each process returned includes details 
such as table name, action type, duration, file count, file size, resource 
allocation, quota, and quota occupation.
   
   ### URL Parameters
   - `optimizerGroup` (string): The unique identifier for the optimizer group.
   - `tableId` (string): The unique identifier for the table.
   
   ### Successful Response
   - **Code**: 200 OK
   - **Content Example**:
     ```json
     [
       {
         "tableName": "my_table",
         "action": "minor",
         "duration": 3600,
         "fileCount": 150,
         "fileSize": 204800,
         "resource": "4c 8g",
         "quota": 0.5,
         "quotaOccupation": 1.2
       },
       {
         "tableName": "my_table",
         "action": "major",
         "duration": 7200,
         "fileCount": 300,
         "fileSize": 409600,
         "resource": "8c 16g",
         "quota": 0.7,
         "quotaOccupation": 1.5
       }
     ]
     ```
   
   ### Error Responses
   - **Code**: 400 Bad Request
     Returned when the provided `optimizerGroup` or `tableId` parameters are 
invalid.
   - **Code**: 404 Not Found
     Returned when the specified optimizer group or table does not exist.
   - **Code**: 500 Internal Server Error
     Returned when there is a server error and the process information cannot 
be retrieved.
   
   ### Notes
   - The `resource` field describes the resource allocation for the process, 
formatted as a string representing CPU cores and memory, e.g., "4c 8g" for 4 
CPU cores and 8 GB of memory.
   - The `quota` field represents the fraction of the resource quota that is 
allocated to the table, with a value ranging from 0 to 1.
   - The `quotaOccupation` field indicates the current occupation of the quota, 
which can exceed 1 if the process is using more resources than initially 
allocated.
   
   These API descriptions provide sufficient information for both frontend and 
backend developers to understand and implement the calling and response 
handling of the interfaces.
   
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to