From a5cc84a9547117996cf1b75cdbc7f126007e2b48 Mon Sep 17 00:00:00 2001 From: DedunuKarunarathne <46235093+DedunuKarunarathne@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:23:10 +0530 Subject: [PATCH 1/2] Create swagger for management API --- .../src/main/resources/management-api.yaml | 1957 +++++++++++++++++ 1 file changed, 1957 insertions(+) create mode 100644 components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml diff --git a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml new file mode 100644 index 0000000000..3adb17ea64 --- /dev/null +++ b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml @@ -0,0 +1,1957 @@ +################################################################################ +# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the \"License\"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an \"AS IS\" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +openapi: 3.0.0 +info: + title: WSO2 MI Management API Documentation + description: Documentation for the WSO2 Micro Integrator Management API + version: 1.0.0 +servers: + - url: https://localhost:9164/management +paths: + /login: + get: + summary: Get JWT Token + description: Retrieve a JWT token by providing username and password. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + AccessToken: + type: string + example: "%AccessToken%" + security: + - BasicAuth: [] + tags: + - Get JWT Token + /logout: + get: + summary: Logout + description: Logout by providing a valid access token. + responses: + '200': + description: "" + security: + - BearerAuth: [] + tags: + - Log out + /users: + get: + summary: Get Users + description: Retrieves a list of all users stored in an external user store or retrieves user information based on a pattern and role. + parameters: + - name: pattern + in: query + schema: + type: string + description: Pattern to search for in user names. + - name: role + in: query + schema: + type: string + description: Role to filter users by. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + userId: + type: string + example: user1 + security: + - BearerAuth: [] + tags: + - User Management + post: + summary: Add User + description: Adds a user to the external user store. Only admin users can create other users with admin access. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + userId: + type: string + example: "user4" + password: + type: string + example: "pwd1" + isAdmin: + type: boolean + example: false + domain: + type: string + example: "wso2.com" + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + userId: + type: string + example: "user4" + status: + type: string + example: "Added" + tags: + - User Management + security: + - BearerAuth: [] + /users/{user_id}: + get: + summary: Get User by ID + description: Retrieves information related to a specified user stored in the external user store. + parameters: + - name: user_id + in: path + required: true + schema: + type: string + description: The ID of the user to retrieve information for. + - name: domain + in: query + schema: + type: string + description: The domain of the user. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + userid: + type: string + example: "WSO2.COM/user1" + isAdmin: + type: boolean + example: true + roles: + type: array + items: + type: string + example: "WSO2.COM/role1" + security: + - BearerAuth: [] + tags: + - User Management + patch: + summary: Update User Password + description: Update the password of a user from the external user store. Any user with admin access can update their own password and the passwords of non-admin users. + parameters: + - name: user_id + in: path + required: true + schema: + type: string + description: The ID of the user to update the password for. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + newPassword: + type: string + example: "newPassword123" + confirmPassword: + type: string + example: "newPassword123" + oldPassword: + type: string + example: "oldPassword123" + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + userId: + type: string + example: "user1" + status: + type: string + example: "Password updated" + tags: + - User Management + security: + - BearerAuth: [] + delete: + summary: Remove User + description: Removes a user from the external user store. + parameters: + - name: user_id + in: path + required: true + schema: + type: string + description: The ID of the user to remove. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + userId: + type: string + status: + type: string + example: "Deleted" + security: + - BearerAuth: [] + tags: + - User Management + /roles: + get: + summary: Get Roles + description: Retrieves a list of all roles stored in an external user store. + tags: + - Role Management + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + role: + type: string + example: "admin" + security: + - BearerAuth: [] + post: + summary: Add Role + description: Adds a role to the external user store. + tags: + - Role Management + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + role: + type: string + example: "wso2role" + domain: + type: string + example: "wso2.com" + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + role: + type: string + example: "wso2role" + status: + type: string + example: "Added" + security: + - BearerAuth: [] + put: + summary: Assign/Revoke Roles + description: Assigns or removes a set of roles to/from a given user in the external user store. + tags: + - Role Management + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + userId: + type: string + example: "wso2user" + addedRoles: + type: array + items: + type: string + example: "Internal/internalRole" + description: Roles to be added to the user. + removedRoles: + type: array + items: + type: string + example: "wso2role" + description: Roles to be removed from the user. + domain: + type: string + example: "wso2.com" + description: The domain of the user. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + userId: + type: string + example: "wso2user" + status: + type: string + example: "Added/removed the roles" + security: + - BearerAuth: [] + /roles/{role_name}: + get: + summary: Get Role + description: Retrieves information related to a specified role stored in the external user store. + tags: + - Role Management + parameters: + - name: role_name + in: path + required: true + schema: + type: string + description: The name of the role to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + role: + type: string + example: "WSO2.COM/wso2role" + users: + type: array + items: + type: string + example: "WSO2.COM/wso2User1" + security: + - BearerAuth: [] + delete: + summary: Remove Role + description: Removes a role from the external user store. + tags: + - Role Management + parameters: + - name: role_name + in: path + required: true + schema: + type: string + description: The name of the role to remove. + - name: domain + in: query + schema: + type: string + description: The domain of the role to remove. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + role: + type: string + example: "wso2role" + status: + type: string + example: "Deleted" + security: + - BearerAuth: [] + /proxy-services: + get: + summary: Get Proxy Services + description: Retrieves a list of all deployed proxy services or information related to a specified proxy. + tags: + - Proxy Services + parameters: + - name: proxyServiceName + in: query + required: false + schema: + type: string + description: The name of the proxy service to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + example: "TestProxy" + wsdl1_1: + type: string + example: "http://ThinkPad-X1-Carbon-3rd:8290/services/TestProxy?wsdl" + wsdl2_0: + type: string + example: "http://ThinkPad-X1-Carbon-3rd:8290/services/TestProxy?wsdl2" + security: + - BearerAuth: [] + post: + summary: Activate/Deactivate Proxy Services & Enable/Disable Message tracing + description: | + Perform the following actions by providing the request body as follow. + + - **Activate/Deactivate Proxy Service:** Activate or deactivate a specified proxy service by providing the name of the proxy service and the desired status. + ``` + { + "name": "HelloWorld", + "status": "inactive" + } + ``` + + - **Enable/Disable Message Tracing:** Enable or disable message tracing for a specified proxy service by providing the name of the proxy service and the desired trace status. + ``` + { + "name": "HelloWorld", + "trace": "enable" + } + ``` + tags: + - Proxy Services + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "HelloWorld" + status: + type: string + enum: ["active", "inactive"] + example: "inactive" + description: Specify "active" to activate or "inactive" to deactivate the proxy service. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + Message: + type: string + example: "Proxy service HelloWorld stopped successfully" + security: + - BearerAuth: [] + /applications: + get: + summary: Get Carbon Applications + description: Provides a list of available active and faulty applications. + tags: + - Carbon Applications + parameters: + - name: carbonAppName + in: query + schema: + type: string + description: The name of the carbon application to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + totalCount: + type: integer + example: 2 + activeCount: + type: integer + example: 1 + faultyCount: + type: integer + example: 1 + activeList: + type: array + items: + type: object + properties: + name: + type: string + example: "HealthcareIntegrationProjectCompositeExporter" + version: + type: string + example: "1.0.0" + artifacts: + type: array + items: + type: object + properties: + name: + type: string + example: "HealthcareAPI" + type: + type: string + example: "api" + faultyList: + type: array + items: + type: object + properties: + name: + type: string + example: "FaultyCAppCompositeExporter" + version: + type: string + example: "1.0.0" + security: + - BearerAuth: [] + post: + summary: Add Carbon Application + description: Adds a carbon application to the deployment folder for hot deployment. + tags: + - Carbon Applications + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + Message: + type: string + example: "Successfully added Carbon Application HelloWorldCompositeExporter_1.0.0.car" + security: + - BearerAuth: [] + /endpoints: + get: + summary: Get Endpoints + description: Retrieves a list of available endpoints or information related to a specified endpoint. + tags: + - Endpoints + parameters: + - name: endpointName + in: query + required: false + schema: + type: string + description: The name of the endpoint to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + example: "GrandOakEndpoint" + type: + type: string + example: "http" + isActive: + type: boolean + example: true + + security: + - BearerAuth: [] + post: + summary: Activate/Deactivate Endpoints & Enable/Disable Message Tracing + description: | + Perform the following actions by providing the request body as follow. + + - **Activate/Deactivate Endpoint:** Activate or deactivate a specified endpoint by providing the name of the endpoint and the desired status. + ``` + { + "name": "HTTPEP", + "status": "inactive" + } + ``` + + - **Enable/Disable Message Tracing:** Enable or disable message tracing for a specified endpoint by providing the name of the endpoint and the desired trace status. + ``` + { + "name": "HTTPEP", + "trace": "enable" + } + ``` + tags: + - Endpoints + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the endpoint to activate or deactivate. + example: HTTPEP + status: + type: string + enum: [active, inactive] + description: The status to set for the endpoint. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + Message: + type: string + example: HTTPEP is switched Off + security: + - BearerAuth: [] + /apis: + get: + summary: Get APIs + description: Retrieves a list of available APIs or information related to a specified API. + tags: + - APIs + parameters: + - name: apiName + in: query + required: false + schema: + type: string + description: The name of the api to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + tracing: + type: string + example: disabled + name: + type: string + example: "TestAPI" + url: + type: string + example: "http://localhost:8290/test" + security: + - BearerAuth: [] + post: + summary: Enable or Disable Message Tracing for API + description: Enable or disable message tracing for a specified API. + tags: + - APIs + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the API to enable or disable tracing. + example: TestAPI + trace: + type: string + enum: [enable, disable] + description: The action to perform for tracing. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Enabled tracing for ('TestAPI') + security: + - BearerAuth: [] + /sequences: + get: + summary: Get Sequences + description: Retrieves a list of available sequences or information related to a specified sequence. + tags: + - Sequences + parameters: + - name: sequenceName + in: query + required: false + schema: + type: string + description: The name of the sequence to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + container: + type: string + example: "[ Deployed From Artifact Container: helloCompositeApplication ] " + tracing: + type: string + example: disabled + stats: + type: string + example: disabled + name: + type: string + example: sequenceForSampler + security: + - BearerAuth: [] + post: + summary: Enable or Disable Message Tracing for Sequence + description: Enable or disable message tracing for a specified sequence. + tags: + - Sequences + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the sequence to enable or disable tracing. + example: helloSequence + trace: + type: string + enum: [enable, disable] + description: The action to perform for tracing. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Enabled tracing for ('helloSequence') + security: + - BearerAuth: [] + /local-entries: + get: + summary: Get Local Entries + description: Retrieves a list of available local entries or information related to a specified local entry. + tags: + - Local Entries + parameters: + - name: name + in: query + required: false + schema: + type: string + description: The name of the local entry to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + example: testEntry1 + type: + type: string + example: Inline Text + security: + - BearerAuth: [] + /tasks: + get: + summary: Get Tasks + description: Retrieves a list of available tasks or information related to a specified task. + tags: + - Tasks + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + example: testTask + parameters: + - name: taskName + in: query + required: false + schema: + type: string + description: The name of the task to retrieve information for. + security: + - BearerAuth: [] + /message-stores: + get: + summary: Get Message Stores + description: Retrieves a list of available message stores or information related to a specified message store. + tags: + - Message Stores + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + size: + type: integer + example: 0 + name: + type: string + example: testMessageStore + type: + type: string + example: in-memory-message-store + parameters: + - name: name + in: query + required: false + schema: + type: string + description: The name of the message-store to retrieve information for. + security: + - BearerAuth: [] + /message-processors: + get: + summary: Get Message Processors + description: Retrieves a list of available message processors or information related to a specified message processor. + tags: + - Message Processors + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + example: testMessageProcessor + type: + type: string + example: Scheduled-message-forwarding-processor + status: + type: string + example: active + parameters: + - name: name + in: query + required: false + schema: + type: string + description: The name of the message processor to retrieve information for. + security: + - BearerAuth: [] + post: + summary: Activate or Deactivate message processor + description: Activate or deactivate a specified message processor. + tags: + - Message Processors + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the message processor to activate or deactivate. + example: testMessageProcessor + status: + type: string + enum: [active, inactive] + description: The status to set for the message processor. + responses: + '200': + description: Successful response + security: + - BearerAuth: [] + /inbound-endpoints: + get: + summary: Get Inbound Endpoints + description: Retrieves a list of available inbound endpoints or information related to a specified inbound endpoint. + tags: + - Inbound Endpoints + parameters: + - name: inboundEndpointName + in: query + required: false + schema: + type: string + description: The name of the inbound Endpoint to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + protocol: + type: string + example: http + name: + type: string + example: HTTPIEP + security: + - BearerAuth: [] + post: + summary: Enable or Disable Message Tracing for Inbound Endpoint + description: Enable or disable message tracing for a specified inbound endpoint. + tags: + - Inbound Endpoints + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the inbound endpoint to enable or disable tracing. + example: HTTPIEP + trace: + type: string + enum: [enable, disable] + description: The action to perform for tracing. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Enabled tracing for ('HTTPIEP') + security: + - BearerAuth: [] + /connectors: + get: + summary: Get Connectors + description: Retrieves a list of available connectors or information related to a specified connector. + tags: + - Connectors + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + type: object + properties: + package: + type: string + example: org.wso2.carbon.connector + name: + type: string + example: fileconnector + description: + type: string + example: wso2 file connector + status: + type: string + example: enabled + security: + - BearerAuth: [] + /templates: + get: + summary: Get Templates + description: Retrieves a list of available templates or information related to a specified template. + tags: + - Templates + parameters: + - name: type + in: query + required: false + schema: + type: string + description: The type of the template to retrieve information for. Supported template types are endpoint & sequence. + - name: name + in: query + required: false + schema: + type: string + description: The name of the template to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + sequenceTemplateList: + type: array + items: + type: object + properties: + name: + type: string + example: testSequenceTemplate + endpointTemplateList: + type: array + items: + type: object + properties: + name: + type: string + example: endpointTemplate + security: + - BearerAuth: [] + post: + summary: Enable or Disable Message Tracing for Sequence Templates + description: Enable or disable message tracing for a specified sequence template. + tags: + - Templates + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the sequence template to enable or disable tracing. + example: testSequenceTemplate + type: + type: string + description: The type of the template to enable or disable tracing. + example: sequence + trace: + type: string + enum: [enable, disable] + description: The action to perform for tracing. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Enabled tracing for ('testSequenceTemplate') + security: + - BearerAuth: [] + /server: + get: + summary: Get server information + description: Retrieves information related to the micro integrator server instance. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + productVersion: + type: string + example: "4.2.0" + osVersion: + type: string + example: "13.2.1" + javaVersion: + type: string + example: "11.0.18" + carbonHome: + type: string + example: "/Users/dedunukarunarathne/Documents/MI" + javaVendor: + type: string + example: "Eclipse Adoptium" + osName: + type: string + example: "Mac OS X" + productName: + type: string + example: "WSO2 Micro Integrator" + javaHome: + type: string + example: "/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home" + security: + - BearerAuth: [] + tags: + - Server Information + patch: + summary: Manage server + description: | + Manage the micro integrator server instance. You can perform the following actions with the given request body: + + - **Shutdown Server:** Initiates an immediate shutdown of the server. + ``` + { + "status": "shutdown" + } + ``` + + - **Shutdown Server Gracefully:** Initiates a graceful shutdown of the server, allowing ongoing processes to complete before shutting down. + ``` + { + "status": "shutdownGracefully" + } + ``` + + - **Restart Server:** Restarts the server immediately. + ``` + { + "status": "restart" + } + ``` + + - **Restart Server Gracefully:** Initiates a graceful restart of the server, allowing ongoing processes to complete before restarting. + ``` + { + "status": "restartGracefully" + } + ``` + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + type: string + enum: + - shutdown + - shutdownGracefully + - restart + - restartGracefully + example: "shutdown" + responses: + '200': + description: The server will start to shutdown. + security: + - BearerAuth: [] + tags: + - Server Management + /data-services: + get: + summary: Get Data Services + description: Retrieves a list of all data services deployed or information related to a specified data service. + tags: + - Data Services + parameters: + - name: dataServiceName + in: query + required: false + schema: + type: string + description: The name of the data service to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + description: The number of data services deployed. + list: + type: array + items: + type: object + properties: + name: + type: string + example: StudentDataService + description: The name of the data service. + wsdl1_1: + type: string + example: http://Sachiths-MacBook-Pro.local:8290/services/StudentDataService?wsdl + description: The WSDL 1.1 URL of the data service. + wsdl2_0: + type: string + example: http://Sachiths-MacBook-Pro.local:8290/services/StudentDataService?wsdl2 + description: The WSDL 2.0 URL of the data service. + security: + - BearerAuth: [] + /data-sources: + get: + summary: Get Data Sources + description: Retrieves a list of all data sources deployed or information related to a specified data source. + tags: + - Data Sources + parameters: + - name: name + in: query + required: false + schema: + type: string + description: The name of the data source to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + example: 1 + description: The number of data sources deployed. + list: + type: array + items: + type: object + properties: + name: + type: string + example: MySQLConnection + description: The name of the data source. + type: + type: string + example: RDBMS + description: The type of the data source. + security: + - BearerAuth: [] + /logging: + get: + summary: Get Log Level + description: Retrieves information related to a specific logger. + tags: + - Logging + parameters: + - in: query + name: loggerName + schema: + type: string + example: org-apache-coyote + required: true + description: The name of the logger to retrieve information for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + level: + type: string + example: WARN + description: The log level of the logger. + componentName: + type: string + example: org.apache.coyote + description: The component name associated with the logger. + loggerName: + type: string + example: org-apache-coyote + description: The name of the logger. + security: + - BearerAuth: [] + patch: + summary: Add New Logger, Update Log Level & Update Root Log Level + description: | + Perform the following actions with the given request body. + + **Add a new logger** + + Request Body: + ``` + { + "loggerName": "synapse-api", + "loggingLevel": "DEBUG", + "loggerClass":"org.apache.synapse.rest.API" + } + ``` + **Update the log level of a specific logger** + + Request Body: + ``` + { + "loggerName": "org-apache-hadoop-hive", + "loggingLevel": "DEBUG" + } + ``` + **Update root log level** + + Request Body: + ``` + { + "loggerName": "rootLogger", + "loggingLevel": "WARN", + } + ``` + tags: + - Logging + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + loggerName: + type: string + description: The name of the logger to update. + example: org-apache-hadoop-hive + loggingLevel: + type: string + description: The new log level for the logger. + example: DEBUG + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully added logger for ('org-apache-hadoop-hive') with level DEBUG + security: + - BearerAuth: [] + /configs: + get: + summary: Get Correlation Logging Configuration Status + description: Retrieves correlation log configuration status. + tags: + - Correlation Logging + parameters: + - in: query + name: configName + schema: + type: string + required: true + description: The name of the configuration to retrieve status for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + configName: + type: string + example: correlation + description: The name of the configuration. + configs: + type: object + properties: + enabled: + type: string + example: false + description: Indicates whether correlation logging is enabled or disabled. + security: + - BearerAuth: [] + put: + summary: Enable/Disable Correlation Logging During Runtime + description: | + Enable or disable correlation logging in a running server. + tags: + - Correlation Logging + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + configName: + type: string + description: The name of the configuration to update. + example: correlation + configs: + type: object + properties: + enabled: + type: boolean + description: Indicates whether to enable or disable correlation logging. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully Updated Correlation Logs Status + security: + - BearerAuth: [] + /transactions/count: + get: + summary: Get Transaction Count + description: Retrieves the transaction count for the specified year and month. If month and year are not specified, retrieves the transaction count for the current month. + tags: + - Transactions + parameters: + - in: query + name: year + schema: + type: integer + format: int32 + description: The year for which the transaction count is to be retrieved. + - in: query + name: month + schema: + type: integer + format: int32 + description: The month for which the transaction count is to be retrieved. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + Month: + type: integer + description: The month for which the transaction count is retrieved. + example: 1 + Year: + type: integer + description: The year for which the transaction count is retrieved. + example: 2024 + TransactionCount: + type: integer + description: The count of transactions for the specified year and month. + example: 25074026 + security: + - BearerAuth: [] + /transactions/report: + get: + summary: Get Transaction Report Data + description: Retrieves the transaction report for the specified period. Generates the transaction report at the /tmp directory. + tags: + - Transactions + parameters: + - in: query + name: start + schema: + type: string + format: date + required: true + description: The start date of the period for the transaction report. + example: 2024-01 + - in: query + name: end + schema: + type: string + format: date + description: The end date of the period for the transaction report. + example: 2024-03 + responses: + '200': + description: An array with transaction report data columns and values. + security: + - BearerAuth: [] + /registry-resources: + get: + summary: Get Registry Directory Data + description: Retrieves files and folders under the given parent folder with their media type and properties. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + required: true + description: The path of the parent folder to retrieve files and folders from. + - in: query + name: expand + schema: + type: boolean + description: Boolean vallue to retrieve a nested JSON containing all the files and folders under the given parent folder. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + description: The number of files and folders under the specified parent folder. + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + description: The name of the file or folder. + mediaType: + type: string + description: The media type of the file or folder. + properties: + type: array + items: + type: object + properties: + name: + type: string + description: The name of the property. + value: + type: string + description: The value of the property. + description: The properties of the file or folder, if any. + security: + - BearerAuth: [] + /registry-resources/content: + get: + summary: Get Registry Content + description: Retrieves content of a registry as text. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + required: true + description: The path of the registry resource to retrieve content from. + responses: + '200': + description: Successful response + content: + text/plain: + schema: + type: string + description: The content of the registry resource as text. + example: + security: + - BearerAuth: [] + post: + summary: Add Registry Resource + description: Adds a new registry resource. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + example: registry/config/testFolder/test-xml.xml + required: true + description: The path where the new registry resource should be added. + - in: query + name: mediaType + schema: + type: string + example: application/xml + required: true + description: The media type of the new registry resource. + requestBody: + required: true + description: Registry content. + content: + application/xml: + schema: + type: string + format: xml + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully added the registry resource + security: + - BearerAuth: [] + put: + summary: Modify Registry Resource Content + description: Modifies the content of an existing registry resource. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + example: registry/config/testFolder/test-xml.xml + required: true + description: The path of the registry resource to modify. + requestBody: + required: true + content: + application/xml: + schema: + type: string + format: xml + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully modified the registry resource + security: + - BearerAuth: [] + delete: + summary: Delete Registry Resource + description: Deletes a registry resource. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + example: registry/config/testFolder/test-xml.xml + required: true + description: The path of the registry resource to delete. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully deleted the registry resource + security: + - BearerAuth: [] + /registry-resources/properties: + get: + summary: Get Properties of a Registry Resource + description: Retrieves the value of a property for a registry resource. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + required: true + description: The path of the registry resource to retrieve properties from. + - in: query + name: name + schema: + type: string + description: The name of the property to retrieve the value for. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + count: + type: integer + description: The number of properties retrieved. + example: 1 + list: + type: array + items: + type: object + properties: + name: + type: string + description: The name of the property. + example: prop1 + value: + type: string + description: The value of the property. + example: val1 + security: + - BearerAuth: [] + post: + summary: Add Properties to Registry Resource + description: Adds properties to a registry resource. If the input payload consists of an existing property name, the property value will be modified. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + example: registry/config/testFolder/test-text.txt + required: true + description: The path of the registry resource to add properties to. + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: object + properties: + name: + type: string + description: The name of the property. + example: prop1 + value: + type: string + description: The value of the property. + example: val1 + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully added the registry property + security: + - BearerAuth: [] + delete: + summary: Delete Property from Registry Resource + description: Deletes a property from a registry resource. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + example: registry/config/testFolder/test-text.txt + required: true + description: The path of the registry resource from which to delete the property. + - in: query + name: name + schema: + type: string + example: prop1 + required: true + description: The name of the property to delete. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Successfully deleted the registry property + security: + - BearerAuth: [] + /registry-resources/metadata: + get: + summary: Get Metadata of Registry Resource + description: Retrieves the metadata of a registry resource. + tags: + - Registry Resources + parameters: + - in: query + name: path + schema: + type: string + example: registry/config/testFolder/test-text.txt + required: true + description: The path of the registry resource. + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the registry resource. + example: test-text.txt + mediaType: + type: string + description: The media type of the registry resource. + example: text/plain + security: + - BearerAuth: [] +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer From d15dd7b1ed547da8ba7d23a10d9eeee1789dd9d5 Mon Sep 17 00:00:00 2001 From: DedunuKarunarathne <46235093+DedunuKarunarathne@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:44:35 +0530 Subject: [PATCH 2/2] Combine Server Information with Server Management --- .../src/main/resources/management-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml index 3adb17ea64..ffd0c1874d 100644 --- a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml +++ b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/resources/management-api.yaml @@ -1237,7 +1237,7 @@ paths: security: - BearerAuth: [] tags: - - Server Information + - Server Management patch: summary: Manage server description: |