Name | k2hr3client JSON |
Version |
1.1.2
JSON |
| download |
home_page | None |
Summary | k2hr3client for python |
upload_time | 2024-10-11 09:31:55 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2020 Yahoo Japan Corporation Copyright (c) 2024 LY Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
k2hr3
antpickax
openstack
iaas
k2hdkc_dbaas
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
==================
k2hr3client_python
==================
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://github.com/yahoojapan/k2hr3client_python/blob/master/LICENSE
.. image:: https://img.shields.io/pypi/pyversions/k2hr3client.svg
:target: https://pypi.python.org/pypi/k2hr3client
.. image:: https://img.shields.io/github/forks/yahoojapan/k2hr3client_python.svg
:target: https://github.com/yahoojapan/k2hr3client_python/network
.. image:: https://img.shields.io/github/stars/yahoojapan/k2hr3client_python.svg
:target: https://github.com/yahoojapan/k2hr3client_python/stargazers
.. image:: https://img.shields.io/github/issues/yahoojapan/k2hr3client_python.svg
:target: https://github.com/yahoojapan/k2hr3client_python/issues
.. image:: https://github.com/yahoojapan/k2hr3client_python/workflows/Python%20package/badge.svg
:target: https://github.com/yahoojapan/k2hr3client_python/actions
.. image:: https://readthedocs.org/projects/k2hr3client-python/badge/?version=latest
:target: https://k2hr3client-python.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/pypi/v/k2hr3client
:target: https://pypi.org/project/k2hr3client/
Overview
---------
k2hr3client_python is an official Python WebAPI client for `k2hr3`_.
.. _`k2hr3`: https://k2hr3.antpick.ax/
.. image:: https://k2hr3.antpick.ax/images/top_k2hr3.png
Install
--------
Let's install k2hr3client_python using pip::
pip install k2hr3client
Usage
------
Let's try to get a token and create a resource.::
>>> from k2hr3client.token import K2hr3Token
>>> iaas_user = "demo"
>>> iaas_project = "demo"
>>> iaas_token_url = "http://172.24.4.1/identity/v3/auth/tokens"
>>> iaas_token = K2hr3Token.get_openstack_token(
... iaas_token_url, iaas_user, "password", iaas_project
... )
>>> mytoken = K2hr3Token(iaas_project, iaas_token)
>>>
>>> from k2hr3client.http import K2hr3Http
>>> k2hr3_token_url = "http://127.0.0.1:18080"
>>> myhttp = K2hr3Http(k2hr3_token_url)
>>> myhttp.POST(mytoken.create())
>>> mytoken.token // k2hr3 token
>>>
>>> from k2hr3client.resource import K2hr3Resource
>>> k2hr3_resource_name = "test_resource"
>>> myresource = K2hr3Resource(mytoken.token)
>>> myhttp.POST(
... myresource.create_conf_resource(
... name=k2hr3_resource_name,
... data_type="string",
... data="testresourcedata",
... keys={
... "cluster-name": "test-cluster",
... "chmpx-server-port": "8020",
... "chmpx-server-ctrlport": "8021",
... "chmpx-slave-ctrlport": "8031"},
... alias=[])
... )
>>> myresource.resp.body // {"result":true...
Settings
---------
To customize the settings of this library, place the configuration file in one of the following locations.::
$PWD/k2hr3client.ini
$HOME/.k2hr3client.ini
/etc/antpickax/k2hr3client.ini
To use the settings in your program, see the following example.::
>>> from k2hr3client import CONFIG
>>> print(CONFIG['DEFAULT']['iaas_user'])
demo
Here are the default settings.
+---------+------------------------+-------------------------------------------------+------------------------+
| section | key name | description | default value |
+=========+========================+=================================================+========================+
| DEFAULT | debug | Enable debug log if True | False |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | iaas_url | IaaS API URL(OpenStack) | http://172.24.4.1 |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | iaas_project | IaaS project name | demo |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | iaas_user | IaaS user name | demo |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | iaas_password | IaaS password of the user | password |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | log_file | log file name | sys.stderr |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | log_dir | log directory name | logs |
+---------+------------------------+-------------------------------------------------+------------------------+
| DEFAULT | log_level | log level(error,warn,info,debug,notset) | info |
+---------+------------------------+-------------------------------------------------+------------------------+
| k2hr3 | api_url | k2hr3 API URL | http://127.0.0.1:18080 |
+---------+------------------------+-------------------------------------------------+------------------------+
| k2hr3 | api_version | k2hr3 api version | v1 |
+---------+------------------------+-------------------------------------------------+------------------------+
| http | timeout_seconds | timeout to establish tcp connections | 30 |
+---------+------------------------+-------------------------------------------------+------------------------+
| http | retry_interval_seconds | interval to reconnect with HTTP server | 60 |
+---------+------------------------+-------------------------------------------------+------------------------+
| http | max_retries | maximum count to reconnect with HTTP server | 3 |
+---------+------------------------+-------------------------------------------------+------------------------+
| http | allow_self_signed_cert | Allow to use self-signed certification in HTTPS | False |
+---------+------------------------+-------------------------------------------------+------------------------+
Development
------------
Clone this repository and go into the directory, then run the following command::
$ make init
$ pipenv shell
$ make lint test docs build
Documents
----------
Here are documents including other components.
`Document top page`_
`About K2HR3`_
`About AntPickax`_
.. _`Document top page`: https://k2hr3client-python.readthedocs.io/
.. _`About K2HR3`: https://k2hr3.antpick.ax/
.. _`About AntPickax`: https://antpick.ax
Packages
--------
Here are packages including other components.
`k2hr3client(python packages)`_
.. _`k2hr3client(python packages)`: https://pypi.org/project/k2hr3client/
License
--------
MIT License. See the LICENSE file.
AntPickax
---------
**k2hr3client_python** is a project by AntPickax_, which is an open source team in `LY Corporation`_.
.. _AntPickax: https://antpick.ax/
.. _`LY Corporation`: https://www.lycorp.co.jp/en/company/overview/
Raw data
{
"_id": null,
"home_page": null,
"name": "k2hr3client",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Hirotaka Wakabayashi <hiwakaba@lycorp.co.jp>, Takeshi Nakatani <ggtakec@gmail.com>",
"keywords": "k2hr3, antpickax, OpenStack, iaas, k2hdkc_dbaas",
"author": null,
"author_email": "Hirotaka Wakabayashi <hiwakaba@lycorp.co.jp>, Takeshi Nakatani <ggtakec@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/5d/96/860cfb285a4ad3bcd006b8b1f562901e7c0e7c4a80a55f6ba16a5e72f3ba/k2hr3client-1.1.2.tar.gz",
"platform": null,
"description": "==================\nk2hr3client_python\n==================\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n :target: https://github.com/yahoojapan/k2hr3client_python/blob/master/LICENSE\n.. image:: https://img.shields.io/pypi/pyversions/k2hr3client.svg\n :target: https://pypi.python.org/pypi/k2hr3client\n.. image:: https://img.shields.io/github/forks/yahoojapan/k2hr3client_python.svg\n :target: https://github.com/yahoojapan/k2hr3client_python/network\n.. image:: https://img.shields.io/github/stars/yahoojapan/k2hr3client_python.svg\n :target: https://github.com/yahoojapan/k2hr3client_python/stargazers\n.. image:: https://img.shields.io/github/issues/yahoojapan/k2hr3client_python.svg\n :target: https://github.com/yahoojapan/k2hr3client_python/issues\n.. image:: https://github.com/yahoojapan/k2hr3client_python/workflows/Python%20package/badge.svg\n :target: https://github.com/yahoojapan/k2hr3client_python/actions\n.. image:: https://readthedocs.org/projects/k2hr3client-python/badge/?version=latest\n :target: https://k2hr3client-python.readthedocs.io/en/latest/?badge=latest\n.. image:: https://img.shields.io/pypi/v/k2hr3client\n :target: https://pypi.org/project/k2hr3client/\n\n\n\nOverview\n---------\n\nk2hr3client_python is an official Python WebAPI client for `k2hr3`_.\n\n.. _`k2hr3`: https://k2hr3.antpick.ax/\n\n.. image:: https://k2hr3.antpick.ax/images/top_k2hr3.png\n\n\nInstall\n--------\n\nLet's install k2hr3client_python using pip::\n\n pip install k2hr3client\n\n\nUsage\n------\n\nLet's try to get a token and create a resource.::\n\n >>> from k2hr3client.token import K2hr3Token\n >>> iaas_user = \"demo\"\n >>> iaas_project = \"demo\"\n >>> iaas_token_url = \"http://172.24.4.1/identity/v3/auth/tokens\"\n >>> iaas_token = K2hr3Token.get_openstack_token(\n ... iaas_token_url, iaas_user, \"password\", iaas_project\n ... )\n >>> mytoken = K2hr3Token(iaas_project, iaas_token)\n >>>\n >>> from k2hr3client.http import K2hr3Http\n >>> k2hr3_token_url = \"http://127.0.0.1:18080\"\n >>> myhttp = K2hr3Http(k2hr3_token_url)\n >>> myhttp.POST(mytoken.create())\n >>> mytoken.token // k2hr3 token\n >>>\n >>> from k2hr3client.resource import K2hr3Resource\n >>> k2hr3_resource_name = \"test_resource\"\n >>> myresource = K2hr3Resource(mytoken.token)\n >>> myhttp.POST(\n ... myresource.create_conf_resource(\n ... name=k2hr3_resource_name,\n ... data_type=\"string\",\n ... data=\"testresourcedata\",\n ... keys={\n ... \"cluster-name\": \"test-cluster\",\n ... \"chmpx-server-port\": \"8020\",\n ... \"chmpx-server-ctrlport\": \"8021\",\n ... \"chmpx-slave-ctrlport\": \"8031\"},\n ... alias=[])\n ... )\n >>> myresource.resp.body // {\"result\":true...\n\n\nSettings\n---------\n\nTo customize the settings of this library, place the configuration file in one of the following locations.::\n\n $PWD/k2hr3client.ini\n $HOME/.k2hr3client.ini\n /etc/antpickax/k2hr3client.ini\n\nTo use the settings in your program, see the following example.::\n\n >>> from k2hr3client import CONFIG\n >>> print(CONFIG['DEFAULT']['iaas_user'])\n demo\n\nHere are the default settings.\n\n+---------+------------------------+-------------------------------------------------+------------------------+\n| section | key name | description | default value |\n+=========+========================+=================================================+========================+\n| DEFAULT | debug | Enable debug log if True | False |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | iaas_url | IaaS API URL(OpenStack) | http://172.24.4.1 |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | iaas_project | IaaS project name | demo |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | iaas_user | IaaS user name | demo |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | iaas_password | IaaS password of the user | password |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | log_file | log file name | sys.stderr |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | log_dir | log directory name | logs |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| DEFAULT | log_level | log level(error,warn,info,debug,notset) | info |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| k2hr3 | api_url | k2hr3 API URL | http://127.0.0.1:18080 |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| k2hr3 | api_version | k2hr3 api version | v1 |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| http | timeout_seconds | timeout to establish tcp connections | 30 |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| http | retry_interval_seconds | interval to reconnect with HTTP server | 60 |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| http | max_retries | maximum count to reconnect with HTTP server | 3 |\n+---------+------------------------+-------------------------------------------------+------------------------+\n| http | allow_self_signed_cert | Allow to use self-signed certification in HTTPS | False |\n+---------+------------------------+-------------------------------------------------+------------------------+\n\n\nDevelopment\n------------\n\nClone this repository and go into the directory, then run the following command::\n\n $ make init\n $ pipenv shell\n $ make lint test docs build\n\n\nDocuments\n----------\n\nHere are documents including other components.\n\n`Document top page`_\n\n`About K2HR3`_\n\n`About AntPickax`_\n\n.. _`Document top page`: https://k2hr3client-python.readthedocs.io/\n.. _`About K2HR3`: https://k2hr3.antpick.ax/\n.. _`About AntPickax`: https://antpick.ax\n\n\nPackages\n--------\n\nHere are packages including other components.\n\n`k2hr3client(python packages)`_\n\n.. _`k2hr3client(python packages)`: https://pypi.org/project/k2hr3client/\n\n\nLicense\n--------\n\nMIT License. See the LICENSE file.\n\n\nAntPickax\n---------\n\n**k2hr3client_python** is a project by AntPickax_, which is an open source team in `LY Corporation`_.\n\n.. _AntPickax: https://antpick.ax/\n.. _`LY Corporation`: https://www.lycorp.co.jp/en/company/overview/\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2020 Yahoo Japan Corporation Copyright (c) 2024 LY Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "k2hr3client for python",
"version": "1.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/yahoojapan/k2hr3client_python/issues",
"Changelog": "https://github.com/yahoojapan/k2hr3client_python/blob/master/HISTORY.rst",
"Documentation": "https://k2hr3client-python.readthedocs.org",
"Homepage": "https://github.com/yahoojapan/k2hr3client_python",
"Repository": "https://github.com/yahoojapan/k2hr3client_python.git"
},
"split_keywords": [
"k2hr3",
" antpickax",
" openstack",
" iaas",
" k2hdkc_dbaas"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fc1b071622125769bafbf45c2e0ca9b73ea9148d5e5ba192fcc3842a2161ab26",
"md5": "1b7a4a3bf5570eebd3938b1d1d890c39",
"sha256": "44cb53cac2719581009270e4371c87b9fe9679cb4afdeaa7dcf7e4394edf1804"
},
"downloads": -1,
"filename": "k2hr3client-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1b7a4a3bf5570eebd3938b1d1d890c39",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 44060,
"upload_time": "2024-10-11T09:31:54",
"upload_time_iso_8601": "2024-10-11T09:31:54.305915Z",
"url": "https://files.pythonhosted.org/packages/fc/1b/071622125769bafbf45c2e0ca9b73ea9148d5e5ba192fcc3842a2161ab26/k2hr3client-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5d96860cfb285a4ad3bcd006b8b1f562901e7c0e7c4a80a55f6ba16a5e72f3ba",
"md5": "f728f7881baa18266041f47829b2b162",
"sha256": "59eb9c5b0604e6c27557e956bca0d7e9023dcfad737e7d4d13929a74626b7381"
},
"downloads": -1,
"filename": "k2hr3client-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "f728f7881baa18266041f47829b2b162",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 128507,
"upload_time": "2024-10-11T09:31:55",
"upload_time_iso_8601": "2024-10-11T09:31:55.898900Z",
"url": "https://files.pythonhosted.org/packages/5d/96/860cfb285a4ad3bcd006b8b1f562901e7c0e7c4a80a55f6ba16a5e72f3ba/k2hr3client-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-11 09:31:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yahoojapan",
"github_project": "k2hr3client_python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "k2hr3client"
}