****************
xldeploy-py
****************
Python SDK for XL-Deploy_.
.. _XL-Deploy: https://xebialabs.com/products/xl-deploy
Usage
=======
.. code:: python
import xldeploy
config = xldeploy.Config(protocol="http", host="localhost", port="4516", context_path="deployit", username="admin", password="admin")
# If you are using url
config = xldeploy.Config.initialize(url="http://localhost:4516/deployit", username="admin", password="admin")
# If you are using proxies
config = xldeploy.Config(protocol="http", host="localhost", port="4516", context_path="deployit", username="admin", password="admin", proxy_host="localhost", proxy_port=8080, proxy_username="proxyUsername", proxy_password="proxyPassword")
# or
config = xldeploy.Config()
client = xldeploy.Client(config)
# repository
repository = client.repository
print(repository.exists("Applications/EC2/1.0/ec2"))
print(repository.exists("Applications/EC2/1.0/wrong"))
ci = repository.read("Applications/EC2/1.0/ec2")
print(ci.amiId)
# deployment
deployment = client.deployment
deploymentRef = deployment.prepare_initial("Applications/NIApp/1.0", "Environments/awsEnv")
depl = deployment.prepare_auto_deployeds(deploymentRef)
task = deployment.create_task(depl)
task.start()
print(task.task_id)
# Deployfile
## Apply Deployfile script.
import re
from os import path
deployfile = client.deployfile
deploy_file = open('deploy_file_path', 'rb').read()
file_names = re.findall('upload\([\'|"](.*)[\'|"]\)', deploy_file.decode("utf-8"))
files_to_upload = [path.abspath(path.join(path.abspath(path.join(file_path, "..")), name)) for name in file_names]
deployfile.apply('deploy_file_path',files_to_upload)
## POST of multiple multipart-encoded binary files
Based on Python [requests](https://pypi.python.org/pypi/requests) module, see [docs](http://docs.python-requests.org/en/master/user/advanced/#advanced)
## Generate Deployfile script.
deployfile = client.deployfile
deployfile.generate([Environments/directory1,Environments/directory1])
Installing from the PyPi repository
===================================
::
$ pip install xldeploy-py
Installing package directly from source
=======================================
::
$ cd xldeploy-py
$ pip install --editable .
Raw data
{
"_id": null,
"home_page": "https://github.com/xebialabs/xldeploy-py",
"name": "xldeploy-py",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "xldeploy sdk python xebialabs",
"author": "Xebialabs",
"author_email": "opensource@xebialabs.com",
"download_url": "https://files.pythonhosted.org/packages/ad/d9/366fae18349dd16a50d295a6159efab54593bb1b0b91dfbdf8d579b30e05/xldeploy-py-0.0.20.tar.gz",
"platform": null,
"description": "****************\r\nxldeploy-py\r\n****************\r\nPython SDK for XL-Deploy_.\r\n\r\n.. _XL-Deploy: https://xebialabs.com/products/xl-deploy\r\n\r\n\r\nUsage\r\n=======\r\n\r\n.. code:: python\r\n\r\n import xldeploy\r\n\r\n config = xldeploy.Config(protocol=\"http\", host=\"localhost\", port=\"4516\", context_path=\"deployit\", username=\"admin\", password=\"admin\")\r\n\r\n # If you are using url\r\n config = xldeploy.Config.initialize(url=\"http://localhost:4516/deployit\", username=\"admin\", password=\"admin\")\r\n\r\n # If you are using proxies\r\n config = xldeploy.Config(protocol=\"http\", host=\"localhost\", port=\"4516\", context_path=\"deployit\", username=\"admin\", password=\"admin\", proxy_host=\"localhost\", proxy_port=8080, proxy_username=\"proxyUsername\", proxy_password=\"proxyPassword\")\r\n\r\n # or\r\n config = xldeploy.Config()\r\n client = xldeploy.Client(config)\r\n\r\n # repository\r\n repository = client.repository\r\n print(repository.exists(\"Applications/EC2/1.0/ec2\"))\r\n print(repository.exists(\"Applications/EC2/1.0/wrong\"))\r\n ci = repository.read(\"Applications/EC2/1.0/ec2\")\r\n print(ci.amiId)\r\n\r\n # deployment\r\n deployment = client.deployment\r\n deploymentRef = deployment.prepare_initial(\"Applications/NIApp/1.0\", \"Environments/awsEnv\")\r\n depl = deployment.prepare_auto_deployeds(deploymentRef)\r\n task = deployment.create_task(depl)\r\n task.start()\r\n print(task.task_id)\r\n\r\n # Deployfile\r\n\r\n ## Apply Deployfile script.\r\n\r\n import re\r\n from os import path\r\n\r\n deployfile = client.deployfile\r\n deploy_file = open('deploy_file_path', 'rb').read()\r\n file_names = re.findall('upload\\([\\'|\"](.*)[\\'|\"]\\)', deploy_file.decode(\"utf-8\"))\r\n files_to_upload = [path.abspath(path.join(path.abspath(path.join(file_path, \"..\")), name)) for name in file_names]\r\n\r\n deployfile.apply('deploy_file_path',files_to_upload)\r\n\r\n ## POST of multiple multipart-encoded binary files \r\n\r\n Based on Python [requests](https://pypi.python.org/pypi/requests) module, see [docs](http://docs.python-requests.org/en/master/user/advanced/#advanced) \r\n\r\n ## Generate Deployfile script.\r\n\r\n deployfile = client.deployfile\r\n deployfile.generate([Environments/directory1,Environments/directory1])\r\n\r\nInstalling from the PyPi repository\r\n===================================\r\n::\r\n\r\n $ pip install xldeploy-py\r\n\r\nInstalling package directly from source\r\n=======================================\r\n::\r\n\r\n $ cd xldeploy-py\r\n $ pip install --editable .\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The python sdk for xldeploy",
"version": "0.0.20",
"project_urls": {
"Homepage": "https://github.com/xebialabs/xldeploy-py"
},
"split_keywords": [
"xldeploy",
"sdk",
"python",
"xebialabs"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "be00132de17fe0f23c491a4db1ecd7dff77a7e5eee6ab99f7e182cfebb40e54a",
"md5": "2b2f08e3558160edbca1f33ae98d6686",
"sha256": "820f6e0902eb91bef054441dd380273b684407bdf224ae3dcfd30e87933beb50"
},
"downloads": -1,
"filename": "xldeploy_py-0.0.20-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2b2f08e3558160edbca1f33ae98d6686",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18548,
"upload_time": "2024-02-26T07:14:13",
"upload_time_iso_8601": "2024-02-26T07:14:13.199077Z",
"url": "https://files.pythonhosted.org/packages/be/00/132de17fe0f23c491a4db1ecd7dff77a7e5eee6ab99f7e182cfebb40e54a/xldeploy_py-0.0.20-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "add9366fae18349dd16a50d295a6159efab54593bb1b0b91dfbdf8d579b30e05",
"md5": "9ddf17eedbe00551a625af7b76120184",
"sha256": "13a336b7f53247994228d6cbf36b37b835f7a70aa0ad6b15e49e4f465ce2e573"
},
"downloads": -1,
"filename": "xldeploy-py-0.0.20.tar.gz",
"has_sig": false,
"md5_digest": "9ddf17eedbe00551a625af7b76120184",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13237,
"upload_time": "2024-02-26T07:14:15",
"upload_time_iso_8601": "2024-02-26T07:14:15.126733Z",
"url": "https://files.pythonhosted.org/packages/ad/d9/366fae18349dd16a50d295a6159efab54593bb1b0b91dfbdf8d579b30e05/xldeploy-py-0.0.20.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-26 07:14:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xebialabs",
"github_project": "xldeploy-py",
"github_not_found": true,
"lcname": "xldeploy-py"
}