-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.json
1 lines (1 loc) · 17.6 KB
/
openapi.json
1
{"openapi":"3.1.0","info":{"title":"Swagger Functions Store - OpenAPI 3.0","version":"0.0.1"},"paths":{"/generate-openapi":{"get":{"summary":"Generate Openapi","description":"Generate OpenAPI spec and save to file","operationId":"generate_openapi_generate_openapi_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/function/list":{"get":{"tags":["function"],"summary":"List Functions","description":"List all functions in the store.\n\nReturns:\n List of all registered functions","operationId":"list_functions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Function"},"type":"array","title":"Response List Functions"}}}}}}},"/function/all":{"delete":{"tags":["function"],"summary":"Delete All Functions","description":"Delete all functions from the store.\n\nReturns:\n Message confirming deletion with count of deleted functions","operationId":"delete_all_functions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/function/searchByName":{"get":{"tags":["function"],"summary":"Search Functions By Name","description":"Search for functions by name.\n\nParameters:\n name: String to search for in function names (case-sensitive partial match)\n\nReturns:\n List of functions whose names contain the search string","operationId":"search_functions_by_name","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Function"},"title":"Response Search Functions By Name"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/functionJob/{function_job_id}":{"get":{"tags":["function_job"],"summary":"Get Function Job","description":"Get the details of a specific function job.\n\nParameters:\n function_job_id: ID of the function job to retrieve\n\nReturns:\n Function job details including status, inputs, and outputs\n\nRaises:\n HTTPException: If job is not found (404)","operationId":"get_function_job","parameters":[{"name":"function_job_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionJob"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function/job/status":{"get":{"tags":["function_job"],"summary":"Get Jobs Status","description":"Get status of multiple jobs.\n\nParameters:\n job_ids: List of job IDs to check\n\nReturns:\n List of job statuses","operationId":"get_jobs_status","parameters":[{"name":"job_ids","in":"query","required":true,"schema":{"type":"array","items":{"type":"integer"},"title":"Job IDs to check status for"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FunctionJob"},"title":"Response Get Jobs Status"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function/config":{"post":{"tags":["function"],"summary":"Update Function Config","description":"Update function execution configuration settings.\n\nParameters:\n max_parallel_jobs: Maximum number of parallel jobs allowed (default: 10)\n\nReturns:\n Updated configuration settings","operationId":"update_function_config_function_config_post","parameters":[{"name":"max_parallel_jobs","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Max Parallel Jobs"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/functionJobCollection":{"post":{"tags":["function_job_collection"],"summary":"Create Function Job Collection","description":"Create a new function job collection.\n\nParameters:\n collection: Collection details including name and optional description\n\nReturns:\n Created function job collection","operationId":"create_function_job_collection","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionJobCollection"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionJobCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/functionJobCollection/list":{"get":{"tags":["function_job_collection"],"summary":"List Function Job Collections","description":"List all function job collections.\n\nReturns:\n List of all function job collections","operationId":"list_function_job_collections","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FunctionJobCollection"},"type":"array","title":"Response List Function Job Collections"}}}}}}},"/function/{function_id}/batch":{"post":{"tags":["function"],"summary":"Batch Run Function","description":"Run a function with multiple inputs and create a job collection.\n\nParameters:\n function_id: ID of the function to run\n collection_name: Name for the job collection\n request_body: List of JSON strings containing input parameters\n max_workers: Optional maximum number of parallel workers\n\nReturns:\n Created function job collection containing all job IDs","operationId":"batch_run_function","parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Id"}},{"name":"collection_name","in":"query","required":true,"schema":{"type":"string","title":"Collection Name"}},{"name":"max_workers","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Workers"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionJobCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/functionJobCollection/{collection_id}/status":{"get":{"tags":["function_job_collection"],"summary":"Get Collection Status","description":"Get status of a function job collection.\n\nParameters:\n collection_id: ID of the collection to check\n\nReturns:\n Collection details including current status of all jobs","operationId":"get_collection_status","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"integer","title":"Collection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionJobCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function":{"post":{"tags":["function"],"summary":"Create Function","description":"Create a new function with optional JSON Schema definitions for input and output.\nValidates that provided schemas are valid JSON Schema.\nSupports tags for better organization and searchability.","operationId":"create_function","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Function"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Function"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function/{function_id}/run":{"post":{"tags":["function"],"summary":"Run Function","description":"Run a function with the given inputs.\nValidates inputs and outputs against JSON Schema if defined.","operationId":"run_function","parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Id"}},{"name":"inputs","in":"query","required":true,"schema":{"type":"string","title":"Inputs"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionJob"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function/{function_id}/map":{"post":{"tags":["function"],"summary":"Map Function","description":"Start asynchronous processing of multiple inputs with schema validation.","operationId":"map_function","parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","title":"Function Id"}},{"name":"max_workers","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Workers"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FunctionJob"},"title":"Response Map Function"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/functionJobs":{"get":{"tags":["function_job"],"summary":"List all function jobs with optional filtering","description":"List all function jobs with optional filtering and pagination.\n\nParameters:\n limit: Maximum number of jobs to return (default: all)\n offset: Number of jobs to skip for pagination (default: 0)\n status: Filter by job status (e.g., PENDING, RUNNING, COMPLETED, FAILED)\n function_id: Filter jobs for a specific function\n start_date: Include jobs created after this date\n end_date: Include jobs created before this date\n\nReturns:\n List[FunctionJob]: A filtered list of function jobs","operationId":"list_function_jobs","parameters":[{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Maximum number of jobs to return","title":"Limit"},"description":"Maximum number of jobs to return"},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Number of jobs to skip","title":"Offset"},"description":"Number of jobs to skip"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}],"description":"Filter by job status","title":"Status"},"description":"Filter by job status"},{"name":"function_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by function ID","title":"Function Id"},"description":"Filter by function ID"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter jobs after this date","title":"Start Date"},"description":"Filter jobs after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter jobs before this date","title":"End Date"},"description":"Filter jobs before this date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FunctionJob"},"title":"Response List Function Jobs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function/{function_id}/jobs":{"get":{"tags":["function_job"],"summary":"Get Function Jobs","description":"Get all jobs for a specific function with optional filtering and pagination.","operationId":"get_function_jobs","parameters":[{"name":"function_id","in":"path","required":true,"schema":{"type":"integer","description":"ID of the function to get jobs for","title":"Function Id"},"description":"ID of the function to get jobs for"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Maximum number of jobs to return","default":100,"title":"Limit"},"description":"Maximum number of jobs to return"},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Number of jobs to skip","default":0,"title":"Offset"},"description":"Number of jobs to skip"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}],"description":"Filter by job status","title":"Status"},"description":"Filter by job status"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter jobs after this date","title":"Start Date"},"description":"Filter jobs after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter jobs before this date","title":"End Date"},"description":"Filter jobs before this date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FunctionJob"},"title":"Response Get Function Jobs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/function/searchByTags":{"get":{"tags":["function"],"summary":"Search Functions By Tags","description":"Search for functions by tags.\n\nParameters:\n tags: List of tags to search for\n match_all: If True, functions must have all specified tags. If False, functions must have any of the specified tags.\n\nReturns:\n List of functions that match the tag criteria","operationId":"search_functions_by_tags","parameters":[{"name":"tags","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"description":"Tags to search for","title":"Tags"},"description":"Tags to search for"},{"name":"match_all","in":"query","required":false,"schema":{"type":"boolean","description":"If True, functions must have all tags. If False, functions must have any of the tags.","default":false,"title":"Match All"},"description":"If True, functions must have all tags. If False, functions must have any of the tags."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Function"},"title":"Response Search Functions By Tags"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Function":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"url":{"type":"string","title":"Url"},"description":{"type":"string","title":"Description"},"input_schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Input Schema"},"output_schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Output Schema"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["name","type","url","description"],"title":"Function"},"FunctionJob":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"functionID":{"type":"integer","title":"Functionid"},"status":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}],"default":"PENDING"},"inputs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Outputs"},"job_info":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Job Info"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["functionID"],"title":"FunctionJob"},"FunctionJobCollection":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"job_ids":{"items":{"type":"integer"},"type":"array","title":"Job Ids"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","name","description","job_ids","status"],"title":"FunctionJobCollection","description":"Model for a collection of function jobs"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobStatus":{"type":"string","enum":["PENDING","RUNNING","COMPLETED","FAILED"],"title":"JobStatus"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"function","description":"Function operations"},{"name":"function_job","description":"Function job operations"}]}