{ "info": { "author": "Christian Werder", "author_email": "christian.werder@swisscom.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7" ], "description": "# EC4SAP Python Client\n\n\n## Summary\n\nThis Python client provides an API to access the Swisscom EC4SAP environment in an easy way. It is written in Python 2.7 (a port to Python 3 will follow later). The API is based on the Python client provided by Abiquo.\n\nGIT Repositories: \n\n* https://gitlab.swisscloud.io/itclouds/ec4sap-python-client\n* https://github.com/abiquo/api-python-client\n\n## Get started\n\n1. Install EC4SAP client with 'pip install ec4sap-client' - for the cli you will need to install globally (sudo)\n3. Adapt the config (see below)\n4. Write some code, have fun\n\n##### Example 1: get all VMs accessable by the current user and export it as a .csv (no admin rights needed)\n\n```python\nfrom ec4sap import config\nfrom ec4sap.abiquo_api import *\nfrom ec4sap.abiquo_env import *\nenv = ABIQUO_ENV(\"int\")\nvm = ABQ_VM(env).scanAllTenant(keys=config.CSV_FORMAT_VM)\nprint vm.csvHeader()\nfor i in range(vm.count()): print vm.csvRow(i)\n```\n\n## Setup an environment\nThe\nEC4SAP Python Client uses OAuth1 to authenticate your client in Abiquo. Compared to Oauth2, which is used by the portal to authenticate an user, these credentials are stored fix in the user context of of Abiquo and do not expire. To use the client it is neccessary to register the Application in your EC4SAP user context. This will be made via console (see below).\n\nFirst you need an active OAuth2 Token (Authentication Bearer) - this is the hardest part of the job:\n1. Login to your desired EC4SAP Environment (DEV/INT/PRD)\n2. Open the Developer Console of your browser (F12 on Chrome)\n3. Search for a MOS enabled VM\n4. Select the \"Virtual Machine Services\" in the context menu of the VM\n5. Search for the Parameter \"Authorization: Bearer ...\" in the Request Header of the CMS-Orch API Request (e.q. \".../Folders?...\")\n\nWith this token you are now able to Register your application in Abiquo and generate a set of OAuth1 tokens:\n1. Start the EC4SAP Console (console.py)\n2. Set the desired Environment (most probably prd and/or int)\n\n```bash\n>>> set env int\n```\n\n3. Register your application (name e.q. MyApp is free choosable)\n\n```bash\n>>> reg MyApp 43ee89a5-049d-4f39-b66a-6b72df75a89d\nOK: Registration of application MyApp successful\n\nApplication Name : MyApp\nApplication Key : 123-456-789\nApplication Secret : xxxxxxxxxxxxxxxxx\nAcess Token : abc-def-ghi\nAccess Secret : xxxxxxxxxxxxxxxxx\n```\n\n4. The tokens are now stored locally and your EC4SAP Client is ready. If you need more than one environmemnt you can start over at Nr.1\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.swisscloud.io/itclouds/ec4sap-python-client", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "ec4sap-client", "package_url": "https://pypi.org/project/ec4sap-client/", "platform": "", "project_url": "https://pypi.org/project/ec4sap-client/", "project_urls": { "Homepage": "https://gitlab.swisscloud.io/itclouds/ec4sap-python-client" }, "release_url": "https://pypi.org/project/ec4sap-client/0.1.4/", "requires_dist": [ "requests (>=2.0.0)", "requests-oauthlib (>=0.4.2)", "abiquo-api (>=0.1.14)" ], "requires_python": "", "summary": "EC4SAP Python Client", "version": "0.1.4" }, "last_serial": 5270987, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "327a5c464b75690270d4ae8923480e28", "sha256": "9f6013c50ebde3655f0796cb90510e3a25f3de1909b39ef391f5c473e86720c2" }, "downloads": -1, "filename": "ec4sap_client-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "327a5c464b75690270d4ae8923480e28", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 21115, "upload_time": "2019-03-25T08:33:27", "url": "https://files.pythonhosted.org/packages/d7/fe/dc71a559085eb537fcd5e64d7b0ba8af9072de4ab199de70a54e51151606/ec4sap_client-0.1.3-py2-none-any.whl" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "bada10fc4a24b3d6462385c6c779c7a4", "sha256": "9d557c1f7aa3e7dd3356d4cbf4f442bbcece10312970a1ea798d3049479ca6c1" }, "downloads": -1, "filename": "ec4sap_client-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "bada10fc4a24b3d6462385c6c779c7a4", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 26112, "upload_time": "2019-05-15T07:07:39", "url": "https://files.pythonhosted.org/packages/e1/83/2b5a4e2fb67db0b3e48c82fe14a48b16cff4de027e034274590cb79515d0/ec4sap_client-0.1.4-py2-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bada10fc4a24b3d6462385c6c779c7a4", "sha256": "9d557c1f7aa3e7dd3356d4cbf4f442bbcece10312970a1ea798d3049479ca6c1" }, "downloads": -1, "filename": "ec4sap_client-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "bada10fc4a24b3d6462385c6c779c7a4", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 26112, "upload_time": "2019-05-15T07:07:39", "url": "https://files.pythonhosted.org/packages/e1/83/2b5a4e2fb67db0b3e48c82fe14a48b16cff4de027e034274590cb79515d0/ec4sap_client-0.1.4-py2-none-any.whl" } ] }