Skip to main content

maxwin 框架的sdk

Project description

mwsdk

maxwin 团队常用的服务,包括 kong,rightmanage等,直接从 consul 中读取服务信息

Kong 的使用

from mwsdk import Kong

# 创建kong 服务

k = Kong()

# 向kong注册服务,需jwt认证

k.reg_service('monitor-srv/api/v1.0','192.168.101.88:8999',auth='jwt',kong_uris='monitor-srv/api')

# 向kong注册upstream和tagert,增加负载平衡

k.add_upstream_target('monitor-srv','192.168.101.88:8999',50)

k.add_upstream_target('monitor-srv','192.168.101.99:8888',50)

# 把upstream 注册到kong,不需要认证

k.reg_service('monitor-srv/api/doc','monitor-srv',auth='',kong_uris='monitor-srv/doc')

Rightmanage的使用

from mwsdk import Rightmanage_inner

# Rightmanage为内网的 权限服务,不需要认证

rm = Rightmanage_inner()

# 获取权限资料

status_code,rm_json = rm.permissions('maxwin_web','admin.id')

AIORightmanage_inner 的使用

  • 支持async,方法同 Rightmanage

安装方法

pip install mwsdk

Changes

0.2.13 (2020-05-20)

  • 删除consul_agent_conf变量

0.2.11 (2019-06-26)

  • fix 访问 refresh-permissions错误

0.2.11 (2019-06-26)

  • fix 访问 refresh-permissions错误

0.2.10 (2019-06-25)

  • 增加 refresh-permissions的功能

0.2.9 (2018-12-17)

  • 取 Rightmanage_inner的配置时,near=True

0.2.8 (2018-12-17)

  • 增加创建公司管理者用户的api

0.2.7 (2018-11-13)

  • 增加 api auth-key 认证

0.2.4 (2018-10-25)

  • fix gbk error

0.2.3 (2018-10-25)

  • 增加 kong.add_upstream_target,支持kong的upstream

0.2.0 (2018-09-29)

  • 增加 AIORightmanage_inner和Rightmanage_inner 类

Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mwsdk-0.2.14.tar.gz (9.2 kB view details)

Uploaded Source

File details

Details for the file mwsdk-0.2.14.tar.gz.

File metadata

  • Download URL: mwsdk-0.2.14.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for mwsdk-0.2.14.tar.gz
Algorithm Hash digest
SHA256 5863e5f5f797bd40a802ea24f2f912b2efd8c3959d601ff2e0f4adea8548e573
MD5 177b896b5e827e43c4f6bf2e6b5bb3e3
BLAKE2b-256 87fb71c7b34b3cb650da006c7cbdc55b6bca13fe06daa70e003e13e20f01e5e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page