init_wps_plug.py 689 B

12345678910111213141516171819202122
  1. import json
  2. import requests
  3. import base64
  4. payload = {'data': {"cmd": "enable", "name": "wpsPlugin", "url": "http://172.10.3.110:3000/", "addonType": "wps",
  5. "online": "true"},
  6. 'serverId': '524ef80e-7ccd-43af-9fcb-69f3b0269730'}
  7. payload['data'] = base64.b64encode(json.dumps(payload['data']).encode('utf-8')).decode('utf-8')
  8. headers = {
  9. 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
  10. 'content-type': 'text/plain;charset=UTF-8'
  11. }
  12. resp = requests.post('http://localhost:58890/deployaddons/runParams', data=json.dumps(payload), headers=headers)
  13. # print(resp.text)