From: ashishj1729 Date: Fri, 20 Jun 2025 09:36:26 +0000 (+0530) Subject: Updating Swagger-Api-yamls as per exisiting pipeline_controller apis X-Git-Tag: 4.0.0~1 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F14581%2F1;p=aiml-fw%2Fawmf%2Ftm.git Updating Swagger-Api-yamls as per exisiting pipeline_controller apis Issue-id: AIMLFW-211 Change-Id: I6672c22bab35a15670271f3e5b3ab020ee8733be Signed-off-by: ashishj1729 --- diff --git a/API_docs/training-manager.yaml b/API_docs/training-manager.yaml index 191defd..90036ac 100644 --- a/API_docs/training-manager.yaml +++ b/API_docs/training-manager.yaml @@ -433,15 +433,14 @@ paths: properties: Exception: type: "string" - - /pipelines/{pipe_name}/upload: + /pipelines/{pipeline_name}/upload: post: tags: - Pipeline summary: "Upload pipeline" description: "Uploads a pipeline file to the server." parameters: - - name: "pipe_name" + - name: "pipeline_name" in: "path" required: true type: "string" @@ -471,7 +470,6 @@ paths: properties: Exception: type: "string" - /pipelines/{pipeline_name}/versions: get: tags: @@ -488,12 +486,9 @@ paths: 200: description: "Successful response with pipeline versions" schema: - type: "object" - properties: - versions_list: - type: "array" - items: - type: "string" + type: "array" + items: + type: "string" 500: description: "Internal server error" schema: @@ -501,7 +496,6 @@ paths: properties: Exception: type: "string" - /pipelines: get: tags: @@ -514,10 +508,12 @@ paths: schema: type: "object" properties: - pipeline_names: + pipelines: type: "array" items: - type: "string" + $ref: '#/definitions/PipelineInfo' + total_size: + type: "integer" 500: description: "Internal server error" schema: @@ -525,21 +521,50 @@ paths: properties: Exception: type: "string" - - /experiments: + /pipelines/{pipeline_name}: + get: + tags: + - Pipeline + summary: "Get pipeline details corresponding to pipeline_name" + description: "Get pipeline details corresponding to pipeline_name" + parameters: + - name: "pipeline_name" + in: "path" + required: true + type: "string" + description: "Name of the pipeline" + responses: + 200: + description: "Detail of pipeline_names: corresponding to pipeline_name" + schema: + $ref: '#/definitions/PipelineInfo' + 404: + description: "Pipeline with given pipeline_name not found" + schema: + type: "object" + properties: + error: + type: "string" + 500: + description: "Internal server error" + schema: + type: "object" + properties: + error: + type: "string" + /pipelines/experiments: get: + tags: + - Pipeline summary: "Get all experiment names" description: "Fetches all the names of experiments available." responses: 200: description: "Successful response with all experiment names" schema: - type: "object" - properties: - experiment_names: - type: "array" - items: - type: "string" + type: "array" + items: + type: "string" 500: description: "Internal server error" schema: @@ -716,7 +741,6 @@ paths: type: "integer" title: type: "string" - /featureGroup: delete: tags: @@ -975,4 +999,21 @@ definitions: description: Optional DME port source_name: type: string - description: Optional name of the data source \ No newline at end of file + description: Optional name of the data source + PipelineInfo: + type: "object" + properties: + pipeline_info: + type: object + properties: + created_at: + type: string + format: date-time + description: Timestamp when the pipeline was created + description: + type: string + display_name: + type: string + pipeline_id: + type: string + format: uuid diff --git a/trainingmgr/controller/pipeline_controller.py b/trainingmgr/controller/pipeline_controller.py index e0600dd..4311ae8 100644 --- a/trainingmgr/controller/pipeline_controller.py +++ b/trainingmgr/controller/pipeline_controller.py @@ -44,7 +44,6 @@ def get_pipeline_info_by_name(pipeline_name): LOGGER.error(f"Unexpected error in get_pipeline_info_by_name: {str(err)}") return jsonify({"error": "An unexpected error occurred"}), status.HTTP_500_INTERNAL_SERVER_ERROR - @pipeline_controller.route("/pipelines//versions", methods=['GET']) def get_versions_for_pipeline(pipeline_name): """ @@ -59,8 +58,7 @@ def get_versions_for_pipeline(pipeline_name): Returns: json: - versions_list : list - list containing all versions(as str) + list containing all versions(as str) status code: HTTP status code 200 @@ -80,7 +78,6 @@ def get_versions_for_pipeline(pipeline_name): LOGGER.error(str(err)) return jsonify({"Exception": str(err)}), status.HTTP_500_INTERNAL_SERVER_ERROR - @pipeline_controller.route('/pipelines', methods=['GET']) def get_pipelines(): """ @@ -109,7 +106,7 @@ def get_pipelines(): except Exception as err: LOGGER.error(str(err)) return jsonify({"Exception": str(err)}, status.HTTP_500_INTERNAL_SERVER_ERROR) - + @pipeline_controller.route("/pipelines//upload", methods=['POST']) def upload_pipeline(pipeline_name): """ @@ -170,7 +167,6 @@ def upload_pipeline(pipeline_name): except Exception as err: return jsonify({'result': "Error in uploading Pipeline| Error : " + str(err)}), status.HTTP_500_INTERNAL_SERVER_ERROR - @pipeline_controller.route("/pipelines/experiments", methods=['GET']) def get_all_experiment_names(): """