{ "info": { "author": "shiwei.ma", "author_email": "shiwei.ma@yiducloud.cn", "bugtrack_url": null, "classifiers": [], "description": "===========\nUcenter SDK\n===========\n:Info: \u8be5\u7ec4\u4ef6\u662f\u63d0\u4f9b\u7ed9\u5e94\u7528\u65b9\u4f7f\u7528\u7684\uff0c\u7528\u6765\u8bbf\u95ee\u7528\u6237\u4e2d\u5fc3\u529f\u80fd\u7684SDK\n:Author: shiwei.ma (shiwei.ma@yiducloud.cn)\n:Maintainer: qibin.jin(qibin.jin@yiducloud.cn), shiwei.ma(shiwei.ma@yiducloud.cn)\n\nAbout\n=====\nucenter-sdk \u662f\u67b6\u6784\u7ec4\u65b0\u7528\u6237\u4e2d\u5fc3\u7cfb\u7edf\u63d0\u4f9b\u7684SDK\u3002\n\u7528\u4e8e\u8f85\u52a9\u5185\u90e8\u5e94\u7528\u5f00\u53d1\u8005\u5feb\u901f\u63a5\u5165\u65b0\u7528\u6237\u4e2d\u5fc3\uff0c\u5bf9\u63a5\u5e76\u5b8c\u6210\u5982\uff1a ``\u767b\u5f55`` \uff0c ``\u7528\u6237\u4fe1\u606f\u7ba1\u7406`` \uff0c ``\u5e94\u7528\u4fe1\u606f\u7ba1\u7406`` \uff0c ``\u6743\u9650\u7ba1\u7406`` \uff0c ``\u5355\u70b9\u767b\u5f55\u529f\u80fd`` \uff0c ``\u5e94\u7528\u95f4\u6388\u6743\u7ba1\u7406\u7b49\u529f\u80fd`` \u3002\n\u90e8\u5206\u6587\u6863\u5df2\u7ecf\u66f4\u65b0\u548c\u53d1\u5e03\uff0c\u5305\u62ec\u4e00\u4e2a\u7b80\u660e\u6559\u7a0b\uff0c\u7528\u6237\u6307\u5357\u548c `API\u53c2\u8003\u624b\u518c `_ \u3002\n\nSupported Ucenter Versions\n==========================\nucenter-sdk \u73b0\u652f\u6301Ucenter v2.0.0\n\nInstallation\n============\n\u6211\u4eec\u63a8\u8350\u4f7f\u7528 `pip `_ \u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 ``pip install -i http://devpi.intra.yiducloud.cn/root/yiducloud/+simple/ --trusted-host devpi.intra.yiducloud.cn -U ucenter-sdk`` \u6765\u5b89\u88c5\u5b83\u3002\n\nDependencies\n============\nucenter-sdk \u6240\u4f9d\u8d56\u7684\u53ef\u4ee5\u901a\u8fc7 `pip `_ \u5b89\u88c5\u3002\n\u4f7f\u7528ucenter-sdk \u4f60\u9700\u8981\u6ee1\u8db3:\n\n- requests>=2.1.0\n\nExamples\n========\nSome simple examples of what MongoEngine code looks like:\n\n.. code :: python\n\n # -*- coding:utf-8 -*-\n from ucenter_sdk import uc_call\n\n # \u5e94\u7528\u540d\uff0c\u5e94\u7528\u5fc5\u987b\u5728\u7edf\u4e00\u7528\u6237\u4e2d\u5fc3\u4e2d\u6709\u6ce8\u518c\n # \u5982\u679c\u662f\u65b0\u5e94\u7528\uff0c\u53ef\u4ee5\u627e\u7ba1\u7406\u5458\u6dfb\u52a0\n app_name = 'dep-platform'\n\n # \u5e94\u7528\u95f4\u6388\u6743\uff08OAUTH2\uff09\u51ed\u8bc1\n # \u5728\u7edf\u4e00\u7528\u6237\u4e2d\u5fc3\u4e2d\u7533\u8bf7\uff08\u7531\u7ba1\u7406\u5458\u6dfb\u52a0\uff09\n oauth2_req_args = {\n 'client_id': 'open-platform', # type: str\n 'client_secret': 'open-platform-secret',\n 'grant_type': 'client_credentials',\n 'scope': 'cluster:all org:all app:all',\n }\n\n # \u5e94\u7528\u6240\u5728\u7684\u96c6\u7fa4\n # \u9ed8\u8ba4\u4e0d\u9700\u8981\u7528\u6237\u6307\u5b9a\uff0c\u4f1a\u5728\u8fd0\u884c\u65f6\uff0c\u7531\u5e73\u53f0\u7684\u73af\u5883\u53d8\u91cf\u81ea\u52a8\u8d4b\u503c\u3002\n #cluster_name = '\u7528\u6237\u4e2d\u5fc3cluster'\n\n # \u7528\u6237\u4e2d\u5fc3\u670d\u52a1\u5730\u5740\n # \u9ed8\u8ba4\u4e0d\u9700\u8981\u7528\u6237\u6307\u5b9a\uff0c\u4f1a\u5728\u8fd0\u884c\u65f6\uff0c\u7531\u5e73\u53f0\u7684\u73af\u5883\u53d8\u91cf\u81ea\u52a8\u8d4b\u503c\u3002\n uc_uri = 'http://localhost:5102'\n\n ucenter = uc_call(client_credential=oauth2_req_args, app_name=app_name, uc_uri=uc_uri)\n\n login_name = 'super_admin'\n password = '123456'\n ucenter_user = ucenter.login_check(login_name=login_name, password=password)\n print(ucenter_user)\n\n >>> \n {\n \"username\": \"super_admin\",\n \"app\": \"{'status': 0, 'by_uid': u'\u7528\u6237\u4e2d\u5fc3', 'createAt': '2018-11-13 21:12:52', 'name': u'\u7528\u6237\u4e2d\u5fc3app', 'updateAt': '2018-11-13 21:12:52', 'removed': False, 'type': u'inner', 'id': '5bc87f1059179433b79d8aa1', 'desc': u'\u7528\u6237\u4e2d\u5fc3'}\",\n \"phone\": null,\n \"updateAt\": \"2018-11-13T21:12:53.200000\",\n \"id\": \"5beacdd5bda7532ebbbd3592\",\n \"auth_phone\": false,\n \"userid\": \"super_admin\",\n \"auth_email\": false,\n \"ext\": {\n \"title\": null,\n \"createAt\": null,\n \"attrs\": null,\n \"department\": null,\n \"updateAt\": null,\n \"id\": null\n },\n \"createAt\": \"2018-11-13T21:12:53.201000\",\n \"fullname\": \"super_admin\",\n \"email\": null\n }\n\nTests\n=====\n\u8fd0\u884c\u6d4b\u8bd5\u7528\u4f8b\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "user,ucenter", "license": "", "maintainer": "", "maintainer_email": "", "name": "ucenter-sdk", "package_url": "https://pypi.org/project/ucenter-sdk/", "platform": "", "project_url": "https://pypi.org/project/ucenter-sdk/", "project_urls": null, "release_url": "https://pypi.org/project/ucenter-sdk/1.0.13/", "requires_dist": [ "requests (>=2.11.1)" ], "requires_python": "", "summary": "YIDU UCenter SDK.", "version": "1.0.13" }, "last_serial": 5691092, "releases": { "1.0.13": [ { "comment_text": "", "digests": { "md5": "97d4f653e3150b6933e3d46082574181", "sha256": "ff7f8692454a5cec4dd4a3b4b6d95ebddb262050cda5e7073fc8371f96b90448" }, "downloads": -1, "filename": "ucenter_sdk-1.0.13-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "97d4f653e3150b6933e3d46082574181", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24632, "upload_time": "2019-08-17T09:09:20", "url": "https://files.pythonhosted.org/packages/2b/f8/c36aebf374a529c5b7ce177b802a11f68ce8931cbadb63a3edc07be5421d/ucenter_sdk-1.0.13-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37f6c02906a2d75bd5d735b3e70b4e50", "sha256": "8446d73d10bd31912b62bedb623f638efd362044d0dca30efc437a40f8b28e60" }, "downloads": -1, "filename": "ucenter_sdk-1.0.13.tar.gz", "has_sig": false, "md5_digest": "37f6c02906a2d75bd5d735b3e70b4e50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20041, "upload_time": "2019-08-17T09:09:21", "url": "https://files.pythonhosted.org/packages/67/70/bc438d37f08d91c8fdd27d8c4719aadf0fed568bcd08d0b723b8effc7f51/ucenter_sdk-1.0.13.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "97d4f653e3150b6933e3d46082574181", "sha256": "ff7f8692454a5cec4dd4a3b4b6d95ebddb262050cda5e7073fc8371f96b90448" }, "downloads": -1, "filename": "ucenter_sdk-1.0.13-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "97d4f653e3150b6933e3d46082574181", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24632, "upload_time": "2019-08-17T09:09:20", "url": "https://files.pythonhosted.org/packages/2b/f8/c36aebf374a529c5b7ce177b802a11f68ce8931cbadb63a3edc07be5421d/ucenter_sdk-1.0.13-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37f6c02906a2d75bd5d735b3e70b4e50", "sha256": "8446d73d10bd31912b62bedb623f638efd362044d0dca30efc437a40f8b28e60" }, "downloads": -1, "filename": "ucenter_sdk-1.0.13.tar.gz", "has_sig": false, "md5_digest": "37f6c02906a2d75bd5d735b3e70b4e50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20041, "upload_time": "2019-08-17T09:09:21", "url": "https://files.pythonhosted.org/packages/67/70/bc438d37f08d91c8fdd27d8c4719aadf0fed568bcd08d0b723b8effc7f51/ucenter_sdk-1.0.13.tar.gz" } ] }