diff --git a/README.md b/README.md index 97372c9..a4548c4 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# MC-Workflow-Manager **MC-Workflow-Manager** is one of the components of the [M-CMP](https://github.com/m-cmp/docs/tree/main) platform. With **MC-Workflow-Manager**, you can easily create and execute workflows, as well as modify and delete them as needed. For example, it allows you to create and manage multi-cloud infrastructures and seamlessly deploy applications across multiple clouds. ## Features - Workflow creation and execution - Workflow Stage management - Workflow management --- ## Table of Contents 1. [System Requirements](#system-requirements) 2. [Installation with Docker Compose](#installation-with-docker-compose) 3. [Project Structure](#project-structure) 4. [Run Instructions](#run-instructions) 5. [Contributing](#contributing) 6. [License](#license) --- ## System Requirements To use **mc-workflow-manager**, ensure your system meets the following requirements: - **Operating System**: Linux (Ubuntu 22.04 LTS recommended) - **Java**: OpenJDK 17+ - **Gradle**: v7.6+ - **Docker**: v24.0.2+ - **WorkflowEngine(Jenkins)**: v2.424+ - **Git**: Latest version --- ## Installation with Docker Compose The easiest way to deploy **mc-workflow-manager** is via Docker Compose. Follow the steps below to get started. ### Step 1: Clone the Repository First, clone the `mc-workflow-manager` repository to your local machine: ```bash git clone https://github.com/m-cmp/mc-workflow-manager.git cd mc-workflow-manager ``` ### Step 2: Configure Environment Variables You can customize the following environment variables in the docker-compose.yaml file: ### Workflow Engine - JENKINS_USERNAME: Workflow-engine User Name - JENKINS_PASSWORD: Workflow-engine User Password ### MC-Workflow-Manager - DB_INIT_YN: Database initialization (create, update, create-drop, none ....) - DB_ID: Database user ID - DB_PW: Database user password - Edit these environment variables according to your needs. ### Step 3: Install and Run Docker Compose To bring up the mc-workflow-manager service along with its dependencies, run the following command: ```bash sudo apt update sudo apt install -y docker-compose cd ./script chmod +x setup-docker-no-sudo.sh ./setup-docker-no-sudo.sh cd .. sudo docker-compose up -d ``` This command will pull the necessary Docker images, build the services, and start the containers in detached mode. ### Step 4: Access the Application Once the services are up, you can access the following endpoints: - Swagger UI: http://:18083/swagger-ui/index.html - WorkflowEngine(Jenkins) UI: http://:9800 - Workflow Manager UI: - http://:18083 - OSS Management: http://:18083/web/oss/list - Workflow Stage Management: http://:18083/web/workflowStage/list - Workflow Management: http://:18083/web/workflow/list - Event Listener Management: http://:18083/web/eventListener/list ### Step 5: Stop Services To stop the running services, use: ```bash sudo docker-compose down ``` This will gracefully shut down the containers without removing volumes, allowing you to preserve the state of the database. --- ## Project Structure ```bash mc-workflow-manager/ ├── docker-compose.yaml # Docker Compose file for service orchestration ├── src/ # Source code for the Workflow Manager ├── script/ # Helper scripts for build and execution ├── README.md # Project documentation ├── LICENSE # License information └── docs/ # Additional documentation ``` --- ## Run Instructions ### Manual Build and Run If you prefer to build and run the project manually, follow these steps: - Install Git ```bash sudo apt update sudo apt install -y git ``` - Download mc-workflow-manager Source Code ```bash cd $HOME git clone https://github.com/m-cmp/mc-workflow-manager.git export PROJECT_ROOT=$(pwd)/mc-workflow-manager ``` - Install Required Packages/Tools and Set Environment Variables - Install Java, Docker ```bash cd $PROJECT_ROOT/script sudo chmod +x *.sh . $PROJECT_ROOT/script/init-install.sh ``` - Set Environment Variables ```bash cd $PROJECT_ROOT/script . $PROJECT_ROOT/script/set_env.sh source $HOME/.bashrc ``` - Build and Run - Execute Shell Script ```bash # Run Jenkins . $PROJECT_ROOT/script/run-jenkins.sh # Build Springboot Project . $PROJECT_ROOT/script/build-mc-workflow.sh # Run Springboot Project . $PROJECT_ROOT/script/run-mc-workflow.sh ``` --- ## Contributing We welcome contributions to the **mc-workflow-manager** project! To get involved, follow these steps: 1. Fork the repository on GitHub. 2. Create a feature branch: ```git checkout -b feature-branch```. 3. Commit your changes: ```git commit -m "Add new feature"```. 4. Push the branch: ```git push origin feature-branch```. 5. Open a Pull Request. 6. For detailed guidelines, refer to the Contributing Guide. --- ## License This project is licensed under the terms of the Apache 2.0 License. See the LICENSE file for details. \ No newline at end of file +# MC-Workflow-Manager **MC-Workflow-Manager** is one of the components of the [M-CMP](https://github.com/m-cmp/docs/tree/main) platform. With **MC-Workflow-Manager**, you can easily create and execute workflows, as well as modify and delete them as needed. For example, it allows you to create and manage multi-cloud infrastructures and seamlessly deploy applications across multiple clouds. ## Features - Workflow creation and execution - Workflow Stage management - Workflow management --- ## Table of Contents 1. [System Requirements](#system-requirements) 2. [Installation with Docker Compose](#installation-with-docker-compose) 3. [Project Structure](#project-structure) 4. [Run Instructions](#run-instructions) 5. [Contributing](#contributing) 6. [License](#license) --- ## System Requirements To use **mc-workflow-manager**, ensure your system meets the following requirements: - **Operating System**: Linux (Ubuntu 22.04 LTS recommended) - **Java**: OpenJDK 17+ - **Gradle**: v7.6+ - **Docker**: v24.0.2+ - **WorkflowEngine(Jenkins)**: v2.424+ - **Git**: Latest version --- ## Installation with Docker Compose The easiest way to deploy **mc-workflow-manager** is via Docker Compose. Follow the steps below to get started. ### Step 1: Clone the Repository First, clone the `mc-workflow-manager` repository to your local machine: ```bash git clone https://github.com/m-cmp/mc-workflow-manager.git cd mc-workflow-manager ``` ### Step 2: Configure Environment Variables You can customize the following environment variables in the docker-compose.yaml file: ### Workflow Engine - JENKINS_USERNAME: Workflow-engine User Name - JENKINS_PASSWORD: Workflow-engine User Password ### MC-Workflow-Manager - DB_INIT_YN: Database initialization (create, update, create-drop, none ....) - DB_ID: Database user ID - DB_PW: Database user password - Edit these environment variables according to your needs. ### Step 3: Install and Run Docker Compose To bring up the mc-workflow-manager service along with its dependencies, run the following command: ```bash sudo apt update sudo apt install -y docker-compose cd ./script chmod +x setup-docker-no-sudo.sh ./setup-docker-no-sudo.sh cd .. # The initial user information for the workflow engine is admin / 123456 # If you need to modify, modify docker-compose.yaml sudo docker-compose up -d ``` This command will pull the necessary Docker images, build the services, and start the containers in detached mode. ### Step 4: Access the Application Once the services are up, you can access the following endpoints: - Swagger UI: http://:18083/swagger-ui/index.html - WorkflowEngine(Jenkins) UI: http://:9800 - Workflow Manager UI: - http://:18083 - OSS Management: http://:18083/web/oss/list - Workflow Stage Management: http://:18083/web/workflowStage/list - Workflow Management: http://:18083/web/workflow/list - Event Listener Management: http://:18083/web/eventListener/list ### Step 5: Stop Services To stop the running services, use: ```bash sudo docker-compose down ``` This will gracefully shut down the containers without removing volumes, allowing you to preserve the state of the database. --- ## Project Structure ```bash mc-workflow-manager/ ├── docker-compose.yaml # Docker Compose file for service orchestration ├── src/ # Source code for the Workflow Manager ├── script/ # Helper scripts for build and execution ├── README.md # Project documentation ├── LICENSE # License information └── docs/ # Additional documentation ``` --- ## Run Instructions ### Manual Build and Run If you prefer to build and run the project manually, follow these steps: - Install Git ```bash sudo apt update sudo apt install -y git ``` - Download mc-workflow-manager Source Code ```bash cd $HOME git clone https://github.com/m-cmp/mc-workflow-manager.git export PROJECT_ROOT=$(pwd)/mc-workflow-manager ``` - Install Required Packages/Tools and Set Environment Variables - Install Java, Docker ```bash cd $PROJECT_ROOT/script sudo chmod +x *.sh . $PROJECT_ROOT/script/init-install.sh ``` - Set Environment Variables ```bash cd $PROJECT_ROOT/script . $PROJECT_ROOT/script/set_env.sh source $HOME/.bashrc ``` - Build and Run - Execute Shell Script ```bash # Run Jenkins . $PROJECT_ROOT/script/run-jenkins.sh # Build Springboot Project . $PROJECT_ROOT/script/build-mc-workflow.sh # Run Springboot Project . $PROJECT_ROOT/script/run-mc-workflow.sh ``` --- ## Contributing We welcome contributions to the **mc-workflow-manager** project! To get involved, follow these steps: 1. Fork the repository on GitHub. 2. Create a feature branch: ```git checkout -b feature-branch```. 3. Commit your changes: ```git commit -m "Add new feature"```. 4. Push the branch: ```git push origin feature-branch```. 5. Open a Pull Request. 6. For detailed guidelines, refer to the Contributing Guide. --- ## License This project is licensed under the terms of the Apache 2.0 License. See the LICENSE file for details. \ No newline at end of file diff --git a/api-docs.json b/api-docs.json index 35205ab..89d9f54 100644 --- a/api-docs.json +++ b/api-docs.json @@ -13,32 +13,20 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, - "host": "localhost:18083", + "host": "43.203.254.52:18083", "basePath": "/", "tags": [ - { - "name": "workflow-controller", - "description": "Workflow Controller" - }, { "name": "workflow-stage-controller", "description": "Workflow Stage Controller" }, - { - "name": "oss-type-controller", - "description": "Oss Type Controller" - }, { "name": "workflow-param-controller", "description": "Workflow Param Controller" }, { - "name": "open-api-web-mvc-resource", - "description": "Open Api Web Mvc Resource" - }, - { - "name": "event-listener-controller", - "description": "Event Listener Controller" + "name": "readyz-controller", + "description": "Readyz Controller" }, { "name": "workflow-history-controller", @@ -52,10 +40,6 @@ "name": "swagger-config-resource", "description": "Swagger Config Resource" }, - { - "name": "oss-controller", - "description": "Oss Controller" - }, { "name": "swagger-welcome-web-mvc", "description": "Swagger Welcome Web Mvc" @@ -63,6 +47,26 @@ { "name": "basic-error-controller", "description": "Basic Error Controller" + }, + { + "name": "workflow-controller", + "description": "Workflow Controller" + }, + { + "name": "oss-type-controller", + "description": "Oss Type Controller" + }, + { + "name": "open-api-web-mvc-resource", + "description": "Open Api Web Mvc Resource" + }, + { + "name": "event-listener-controller", + "description": "Event Listener Controller" + }, + { + "name": "oss-controller", + "description": "Oss Controller" } ], "paths": { @@ -351,6 +355,47 @@ } } }, + "/eventlistener/duplicate": { + "get": { + "tags": [ + "event-listener-controller" + ], + "summary": "isEventListenerDuplicated", + "operationId": "isEventListenerDuplicatedUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "eventlistenerName", + "in": "query", + "description": "eventlistenerName", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«boolean»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/eventlistener/list": { "get": { "tags": [ @@ -1238,6 +1283,38 @@ } } }, + "/readyz": { + "get": { + "tags": [ + "readyz-controller" + ], + "summary": "checkConnection", + "operationId": "checkConnectionUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«string»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/swagger-ui.html": { "get": { "tags": [ @@ -1715,6 +1792,106 @@ } } }, + "/workflow/runHistory/{workflowIdx}": { + "get": { + "tags": [ + "workflow-controller" + ], + "summary": "getWorkflowRunHistoryList", + "operationId": "getWorkflowRunHistoryListUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "workflowIdx", + "in": "path", + "description": "workflowIdx", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«List«WorkflowRunHistoryResDto»»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/workflow/stageHistory/{workflowIdx}": { + "get": { + "tags": [ + "workflow-controller" + ], + "summary": "getWorkflowStageHistoryList", + "operationId": "getWorkflowStageHistoryListUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "workflowIdx", + "in": "path", + "description": "workflowIdx", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "buildIdx", + "in": "query", + "description": "buildIdx", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "name": "nodeIdx", + "in": "query", + "description": "nodeIdx", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«JenkinsBuildDescribeLog»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/workflow/template/{workflowName}": { "get": { "tags": [ @@ -2438,6 +2615,9 @@ "script": { "type": "string" }, + "status": { + "type": "string" + }, "workflowIdx": { "type": "integer", "format": "int64" @@ -2483,6 +2663,36 @@ } } }, + "JenkinsStage": { + "type": "object", + "properties": { + "durationMillis": { + "type": "integer", + "format": "int64" + }, + "endTimeMillis": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "pauseDurationMillis": { + "type": "integer", + "format": "int64" + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "ResponseWrapper«List«WorkflowListResDto»»": { "type": "object", "properties": { @@ -2520,33 +2730,18 @@ "eventListenerName": { "type": "string" }, - "eventListenerUrl": { - "type": "string" - }, "workflowIdx": { "type": "integer", "format": "int64" - } - } - }, - "ResponseWrapper«List«ResponseEventListenerDto»»": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" }, - "data": { + "workflowName": { + "type": "string" + }, + "workflowParams": { "type": "array", "items": { - "$ref": "#/definitions/ResponseEventListenerDto" + "$ref": "#/definitions/WorkflowParamDto" } - }, - "detail": { - "type": "string" - }, - "message": { - "type": "string" } } }, @@ -2572,6 +2767,27 @@ } } }, + "ResponseWrapper«List«ResponseEventListenerDto»»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/ResponseEventListenerDto" + } + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, "ResponseWrapper«List«WorkflowLogResDto»»": { "type": "object", "properties": { @@ -2710,6 +2926,51 @@ } } }, + "JenkinsBuildDescribeLog": { + "type": "object", + "properties": { + "durationMillis": { + "type": "integer", + "format": "int64" + }, + "endTimeMillis": { + "type": "integer", + "format": "int64" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "execNode": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameterDescription": { + "type": "string" + }, + "pauseDurationMillis": { + "type": "integer", + "format": "int64" + }, + "stageFlowNodes": { + "type": "array", + "items": { + "$ref": "#/definitions/JenkinsStageFlowNode" + } + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "ResponseWrapper«List«WorkflowStageTypeDto»»": { "type": "object", "properties": { @@ -2773,6 +3034,31 @@ } } }, + "WorkflowRunHistoryResDto": { + "type": "object", + "properties": { + "durationTimeMillis": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "stages": { + "type": "array", + "items": { + "$ref": "#/definitions/JenkinsStage" + } + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "WorkflowStageTypeAndStageNameResDto": { "type": "object", "properties": { @@ -2813,6 +3099,51 @@ } } }, + "JenkinsStageFlowNode": { + "type": "object", + "properties": { + "durationMillis": { + "type": "integer", + "format": "int64" + }, + "endTimeMillis": { + "type": "integer", + "format": "int64" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "execNode": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameterDescription": { + "type": "string" + }, + "parentNodes": { + "type": "array", + "items": { + "type": "string" + } + }, + "pauseDurationMillis": { + "type": "integer", + "format": "int64" + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "RequestEventListenerDto": { "type": "object", "properties": { @@ -2994,6 +3325,45 @@ } } }, + "ResponseWrapper«JenkinsBuildDescribeLog»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "$ref": "#/definitions/JenkinsBuildDescribeLog" + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "ResponseWrapper«List«WorkflowRunHistoryResDto»»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowRunHistoryResDto" + } + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, "OssDto": { "type": "object", "properties": { @@ -3042,6 +3412,17 @@ } } }, + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "ResponseWrapper«List«WorkflowParamDto»»": { "type": "object", "properties": { @@ -3229,6 +3610,52 @@ } } }, + "ResponseWrapper«string»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "type": "string", + "enum": [ + "OK", + "BAD_REQUEST", + "UNAUTHORIZED", + "FORBIDDEN", + "NOT_FOUND", + "METHOD_NOT_ALLOWED", + "CLIENT_ERROR", + "CONFLICT", + "INTERNAL_SERVER_ERROR", + "COMMON_CODE_EXISTS", + "COMMON_CODE_DELETE_NOT_ALLOWED", + "UNKNOWN_ERROR", + "ALREADY_EXISTS", + "CREATE_FAILED_PROJECT_SOURCE", + "CREATE_FAILED_JENKINS_JOB", + "EXISTS_JENKINS_JOB", + "NOT_EXISTS_JENKINS_JOB", + "ERROR_JENKINS_API", + "RUN_FAILED_DEPLOY", + "CREATE_FAILED_APPLICATION", + "NOT_EXISTS_APPLICATION", + "EXISTS_APPLICATION", + "CONNECTION_FAILED_CLUSTER", + "IN_USE_OSS", + "IS_NOT_MAPPED_OSS", + "INCORRECT_JENKINS_CONNECTION_INFO" + ] + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, "WorkflowReqDto": { "type": "object", "properties": { diff --git a/docker-compose.yaml b/docker-compose.yaml index 0c4b37a..f5744a3 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -48,7 +48,9 @@ services: build-timeout, timestamper, ws-cleanup, - ssh-slaves + ssh-slaves, + ssh-agent, + publish-over-ssh healthcheck: # for workflow-manager test: [ "CMD", "curl", "-f", "http://localhost:8080/login" ] interval: 1m diff --git a/swagger.json b/swagger.json index d53db9f..89d9f54 100644 --- a/swagger.json +++ b/swagger.json @@ -5,38 +5,28 @@ "version": "1.0", "title": "Api Documentation", "termsOfService": "urn:tos", - "contact": {}, + "contact": { + + }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, - "host": "localhost:18083", + "host": "43.203.254.52:18083", "basePath": "/", "tags": [ - { - "name": "workflow-controller", - "description": "Workflow Controller" - }, { "name": "workflow-stage-controller", "description": "Workflow Stage Controller" }, - { - "name": "oss-type-controller", - "description": "Oss Type Controller" - }, { "name": "workflow-param-controller", "description": "Workflow Param Controller" }, { - "name": "open-api-web-mvc-resource", - "description": "Open Api Web Mvc Resource" - }, - { - "name": "event-listener-controller", - "description": "Event Listener Controller" + "name": "readyz-controller", + "description": "Readyz Controller" }, { "name": "workflow-history-controller", @@ -50,16 +40,275 @@ "name": "swagger-config-resource", "description": "Swagger Config Resource" }, - { - "name": "oss-controller", - "description": "Oss Controller" - }, { "name": "swagger-welcome-web-mvc", "description": "Swagger Welcome Web Mvc" + }, + { + "name": "basic-error-controller", + "description": "Basic Error Controller" + }, + { + "name": "workflow-controller", + "description": "Workflow Controller" + }, + { + "name": "oss-type-controller", + "description": "Oss Type Controller" + }, + { + "name": "open-api-web-mvc-resource", + "description": "Open Api Web Mvc Resource" + }, + { + "name": "event-listener-controller", + "description": "Event Listener Controller" + }, + { + "name": "oss-controller", + "description": "Oss Controller" } ], "paths": { + "/error": { + "get": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "head": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingHEAD", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "204": { + "description": "No Content" + }, + "403": { + "description": "Forbidden" + } + } + }, + "post": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingPUT", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingDELETE", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "204": { + "description": "No Content" + }, + "403": { + "description": "Forbidden" + } + } + }, + "options": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingOPTIONS", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "204": { + "description": "No Content" + }, + "403": { + "description": "Forbidden" + } + } + }, + "patch": { + "tags": [ + "basic-error-controller" + ], + "summary": "error", + "operationId": "errorUsingPATCH", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "204": { + "description": "No Content" + }, + "403": { + "description": "Forbidden" + } + } + } + }, "/eventlistener": { "post": { "tags": [ @@ -75,25 +324,140 @@ ], "parameters": [ { - "in": "body", - "name": "requestEventListenerDto", - "description": "requestEventListenerDto", + "in": "body", + "name": "requestEventListenerDto", + "description": "requestEventListenerDto", + "required": true, + "schema": { + "$ref": "#/definitions/RequestEventListenerDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«long»" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/eventlistener/duplicate": { + "get": { + "tags": [ + "event-listener-controller" + ], + "summary": "isEventListenerDuplicated", + "operationId": "isEventListenerDuplicatedUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "eventlistenerName", + "in": "query", + "description": "eventlistenerName", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«boolean»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/eventlistener/list": { + "get": { + "tags": [ + "event-listener-controller" + ], + "summary": "getEventListenerList", + "operationId": "getEventListenerListUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«List«ResponseEventListenerDto»»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/eventlistener/run/{eventListenerIdx}": { + "get": { + "tags": [ + "event-listener-controller" + ], + "summary": "runEventListener", + "operationId": "runEventListenerUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "eventListenerIdx", + "in": "path", + "description": "eventListenerIdx", "required": true, - "schema": { - "$ref": "#/definitions/RequestEventListenerDto" - } + "type": "integer", + "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/ResponseWrapper«long»" + "$ref": "#/definitions/ResponseWrapper«boolean»" } }, - "201": { - "description": "Created" - }, "401": { "description": "Unauthorized" }, @@ -106,24 +470,41 @@ } } }, - "/eventlistener/list": { + "/eventlistener/workflowDetail/{workflowIdx}/{evnetListenerYn}": { "get": { "tags": [ "event-listener-controller" ], - "summary": "getEventListenerList", - "operationId": "getEventListenerListUsingGET", + "summary": "getWorkflowDetail", + "operationId": "getWorkflowDetailUsingGET", "consumes": [ "application/json" ], "produces": [ "*/*" ], + "parameters": [ + { + "name": "workflowIdx", + "in": "path", + "description": "workflowIdx", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "evnetListenerYn", + "in": "path", + "description": "evnetListenerYn", + "required": true, + "type": "string" + } + ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/ResponseWrapper«List«ResponseEventListenerDto»»" + "$ref": "#/definitions/ResponseWrapper«WorkflowDetailResDto»" } }, "401": { @@ -138,13 +519,13 @@ } } }, - "/eventlistener/run/{eventListenerIdx}": { + "/eventlistener/workflowList/{eventListenerYn}": { "get": { "tags": [ "event-listener-controller" ], - "summary": "runEventListener", - "operationId": "runEventListenerUsingGET", + "summary": "getWorkflowList", + "operationId": "getWorkflowListUsingGET", "consumes": [ "application/json" ], @@ -153,19 +534,18 @@ ], "parameters": [ { - "name": "eventListenerIdx", + "name": "eventListenerYn", "in": "path", - "description": "eventListenerIdx", + "description": "eventListenerYn", "required": true, - "type": "integer", - "format": "int64" + "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/ResponseWrapper«boolean»" + "$ref": "#/definitions/ResponseWrapper«List«WorkflowListResDto»»" } }, "401": { @@ -708,6 +1088,38 @@ } } }, + "/ossType/filter/list": { + "get": { + "tags": [ + "oss-type-controller" + ], + "summary": "getOssTypeFilteredList", + "operationId": "getOssTypeFilteredListUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«List«OssTypeDto»»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/ossType/list": { "get": { "tags": [ @@ -871,6 +1283,38 @@ } } }, + "/readyz": { + "get": { + "tags": [ + "readyz-controller" + ], + "summary": "checkConnection", + "operationId": "checkConnectionUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«string»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/swagger-ui.html": { "get": { "tags": [ @@ -1085,6 +1529,13 @@ "required": true, "type": "integer", "format": "int64" + }, + { + "name": "dataType", + "in": "query", + "description": "dataType", + "required": true, + "type": "string" } ], "responses": { @@ -1112,7 +1563,7 @@ "workflow-controller" ], "summary": "getWorkflowList", - "operationId": "getWorkflowListUsingGET", + "operationId": "getWorkflowListUsingGET_1", "consumes": [ "application/json" ], @@ -1138,6 +1589,48 @@ } } }, + "/workflow/log/{workflowIdx}": { + "get": { + "tags": [ + "workflow-controller" + ], + "summary": "getWorkflowLog", + "operationId": "getWorkflowLogUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "workflowIdx", + "in": "path", + "description": "workflowIdx", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«List«WorkflowLogResDto»»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/workflow/name/duplicate": { "get": { "tags": [ @@ -1299,6 +1792,106 @@ } } }, + "/workflow/runHistory/{workflowIdx}": { + "get": { + "tags": [ + "workflow-controller" + ], + "summary": "getWorkflowRunHistoryList", + "operationId": "getWorkflowRunHistoryListUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "workflowIdx", + "in": "path", + "description": "workflowIdx", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«List«WorkflowRunHistoryResDto»»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/workflow/stageHistory/{workflowIdx}": { + "get": { + "tags": [ + "workflow-controller" + ], + "summary": "getWorkflowStageHistoryList", + "operationId": "getWorkflowStageHistoryListUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "workflowIdx", + "in": "path", + "description": "workflowIdx", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "buildIdx", + "in": "query", + "description": "buildIdx", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "name": "nodeIdx", + "in": "query", + "description": "nodeIdx", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ResponseWrapper«JenkinsBuildDescribeLog»" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, "/workflow/template/{workflowName}": { "get": { "tags": [ @@ -2009,9 +2602,34 @@ } } } - } - }, - "definitions": { + } + }, + "definitions": { + "WorkflowDto": { + "type": "object", + "properties": { + "ossIdx": { + "type": "integer", + "format": "int64" + }, + "script": { + "type": "string" + }, + "status": { + "type": "string" + }, + "workflowIdx": { + "type": "integer", + "format": "int64" + }, + "workflowName": { + "type": "string" + }, + "workflowPurpose": { + "type": "string" + } + } + }, "ResponseWrapper«OssDto»": { "type": "object", "properties": { @@ -2030,39 +2648,47 @@ } } }, - "WorkflowDto": { + "WorkflowStageTypeDto": { "type": "object", "properties": { - "ossIdx": { - "type": "integer", - "format": "int64" - }, - "script": { + "workflowStageTypeDesc": { "type": "string" }, - "workflowIdx": { + "workflowStageTypeIdx": { "type": "integer", "format": "int64" }, - "workflowName": { - "type": "string" - }, - "workflowPurpose": { + "workflowStageTypeName": { "type": "string" } } }, - "WorkflowStageTypeDto": { + "JenkinsStage": { "type": "object", "properties": { - "workflowStageTypeDesc": { + "durationMillis": { + "type": "integer", + "format": "int64" + }, + "endTimeMillis": { + "type": "integer", + "format": "int64" + }, + "id": { "type": "string" }, - "workflowStageTypeIdx": { + "name": { + "type": "string" + }, + "pauseDurationMillis": { "type": "integer", "format": "int64" }, - "workflowStageTypeName": { + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { "type": "string" } } @@ -2104,7 +2730,35 @@ "eventListenerName": { "type": "string" }, - "eventListenerUrl": { + "workflowIdx": { + "type": "integer", + "format": "int64" + }, + "workflowName": { + "type": "string" + }, + "workflowParams": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowParamDto" + } + } + } + }, + "WorkflowParamDto": { + "type": "object", + "properties": { + "eventListenerYn": { + "type": "string" + }, + "paramIdx": { + "type": "integer", + "format": "int64" + }, + "paramKey": { + "type": "string" + }, + "paramValue": { "type": "string" }, "workflowIdx": { @@ -2134,25 +2788,24 @@ } } }, - "WorkflowParamDto": { + "ResponseWrapper«List«WorkflowLogResDto»»": { "type": "object", "properties": { - "eventListenerYn": { - "type": "string" - }, - "paramIdx": { + "code": { "type": "integer", - "format": "int64" + "format": "int32" }, - "paramKey": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowLogResDto" + } }, - "paramValue": { + "detail": { "type": "string" }, - "workflowIdx": { - "type": "integer", - "format": "int64" + "message": { + "type": "string" } } }, @@ -2273,6 +2926,51 @@ } } }, + "JenkinsBuildDescribeLog": { + "type": "object", + "properties": { + "durationMillis": { + "type": "integer", + "format": "int64" + }, + "endTimeMillis": { + "type": "integer", + "format": "int64" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "execNode": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameterDescription": { + "type": "string" + }, + "pauseDurationMillis": { + "type": "integer", + "format": "int64" + }, + "stageFlowNodes": { + "type": "array", + "items": { + "$ref": "#/definitions/JenkinsStageFlowNode" + } + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "ResponseWrapper«List«WorkflowStageTypeDto»»": { "type": "object", "properties": { @@ -2336,6 +3034,31 @@ } } }, + "WorkflowRunHistoryResDto": { + "type": "object", + "properties": { + "durationTimeMillis": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "stages": { + "type": "array", + "items": { + "$ref": "#/definitions/JenkinsStage" + } + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "WorkflowStageTypeAndStageNameResDto": { "type": "object", "properties": { @@ -2353,14 +3076,17 @@ "WorkflowHistoryDto": { "type": "object", "properties": { - "runDate": { - "type": "string", - "format": "date-time" + "data": { + "type": "string" }, - "runScript": { + "dataType": { "type": "string" }, - "runUserId": { + "date": { + "type": "string", + "format": "date-time" + }, + "userId": { "type": "string" }, "workflowHistoryIdx": { @@ -2373,6 +3099,51 @@ } } }, + "JenkinsStageFlowNode": { + "type": "object", + "properties": { + "durationMillis": { + "type": "integer", + "format": "int64" + }, + "endTimeMillis": { + "type": "integer", + "format": "int64" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "execNode": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameterDescription": { + "type": "string" + }, + "parentNodes": { + "type": "array", + "items": { + "type": "string" + } + }, + "pauseDurationMillis": { + "type": "integer", + "format": "int64" + }, + "startTimeMillis": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + } + } + }, "RequestEventListenerDto": { "type": "object", "properties": { @@ -2554,6 +3325,45 @@ } } }, + "ResponseWrapper«JenkinsBuildDescribeLog»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "$ref": "#/definitions/JenkinsBuildDescribeLog" + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "ResponseWrapper«List«WorkflowRunHistoryResDto»»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowRunHistoryResDto" + } + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, "OssDto": { "type": "object", "properties": { @@ -2602,6 +3412,17 @@ } } }, + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "ResponseWrapper«List«WorkflowParamDto»»": { "type": "object", "properties": { @@ -2723,6 +3544,18 @@ } } }, + "WorkflowLogResDto": { + "type": "object", + "properties": { + "buildIdx": { + "type": "integer", + "format": "int32" + }, + "buildLog": { + "type": "string" + } + } + }, "ResponseWrapper«WorkflowStageDto»": { "type": "object", "properties": { @@ -2777,6 +3610,52 @@ } } }, + "ResponseWrapper«string»": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "data": { + "type": "string", + "enum": [ + "OK", + "BAD_REQUEST", + "UNAUTHORIZED", + "FORBIDDEN", + "NOT_FOUND", + "METHOD_NOT_ALLOWED", + "CLIENT_ERROR", + "CONFLICT", + "INTERNAL_SERVER_ERROR", + "COMMON_CODE_EXISTS", + "COMMON_CODE_DELETE_NOT_ALLOWED", + "UNKNOWN_ERROR", + "ALREADY_EXISTS", + "CREATE_FAILED_PROJECT_SOURCE", + "CREATE_FAILED_JENKINS_JOB", + "EXISTS_JENKINS_JOB", + "NOT_EXISTS_JENKINS_JOB", + "ERROR_JENKINS_API", + "RUN_FAILED_DEPLOY", + "CREATE_FAILED_APPLICATION", + "NOT_EXISTS_APPLICATION", + "EXISTS_APPLICATION", + "CONNECTION_FAILED_CLUSTER", + "IN_USE_OSS", + "IS_NOT_MAPPED_OSS", + "INCORRECT_JENKINS_CONNECTION_INFO" + ] + }, + "detail": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, "WorkflowReqDto": { "type": "object", "properties": { @@ -2798,4 +3677,4 @@ } } } -} +} \ No newline at end of file