Skip to content

Meta

Feature ID WBXPLTFM-177091
Feature Name [MCT] PluginAutoManager to Service (Linux&Windows)
Dev Team MCT
Developers Carl Zhao
Delivery Manager Calvin Yan
Scrum Master Selly Huang

PluginAutoManager Service Design

Background

In the step of Plugin Gray Release Jenkins Pipeline, we need to find a way to trigger PluginAutoManager to run immediately.

Due to PluginAutoManager execution is a scheduled task controlled by cronjob, we need to develop a service to achieve this requirement.

Technical Framework

Due to PluginAutomanager is written in Python, Service is implemented based on Python and use Flask and Waitress in order to code reuse and shorten the development cycle.

Flask: https://flask.palletsprojects.com/

Waitress: https://docs.pylonsproject.org/projects/waitress/

Pip Dependencies: - flask - flask_restful - waitress

API design

Home page

  • Path:/pluginautomanager
  • Response: html

home

HealthCheck

  • Path:/pluginautomanager/healthcheck
  • Method: GET
  • Response: OKOKOK

Install

Trigger Plugin Installation synchronous. - Path: /pluginautomanager/install - Method: PUT - Response: OKOKOK

GetPackages

Return plugin list on current station(starts with WBXmct). - Path: /pluginautomanager/packages - Method: GET - Response: json

{
    "status": "OKOKOK",
    "errorMessage": null,
    "packages": [
        "WBXmctwebcast-1.0.0-28.x86_64",
        "WBXmctESCountMonitor-1.0.0-8.x86_64",
        "WBXmctEdgeAudioConnectivity-1.0.0-109.x86_64",
        "WBXmctHomerPingDirect-1.0.0-4.x86_64",
        "WBXmctCLAPShardsizeMonitor-1.0.0-114.x86_64",
        "WBXmctJavaScheduleMeetingMonitor-1.0.0-118.x86_64",
        "WBXmctglobal-ivr-mgr-file-1.0.0-152.x86_64",
        "WBXmctthinclienthc-1.0.0-14.x86_64",
        "WBXmctSSHMonitor-1.0.0-130.x86_64",
        ...
    ]
}

SearchPackage

Return plugin list which contains pkgname on current station(starts with WBXmct). - Path: /pluginautomanager/packages/<pkgname> - Method: GET - Response: json

Example request: /pluginautomanager/packages/Homer

{
    "status": "OKOKOK",
    "errorMessage": null,
    "packages": [
        "WBXmctHomerPingDirect-1.0.0-4.x86_64",
        "WBXmctHomerPingCheck-1.0.0-83.x86_64"
    ]
}