The python sdk for xldeploy
Project description
Python SDK for XL-Deploy.
Usage
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 .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xldeploy-py-0.0.20.tar.gz
(13.2 kB
view details)
Built Distribution
File details
Details for the file xldeploy-py-0.0.20.tar.gz
.
File metadata
- Download URL: xldeploy-py-0.0.20.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
13a336b7f53247994228d6cbf36b37b835f7a70aa0ad6b15e49e4f465ce2e573
|
|
MD5 |
9ddf17eedbe00551a625af7b76120184
|
|
BLAKE2b-256 |
add9366fae18349dd16a50d295a6159efab54593bb1b0b91dfbdf8d579b30e05
|
File details
Details for the file xldeploy_py-0.0.20-py3-none-any.whl
.
File metadata
- Download URL: xldeploy_py-0.0.20-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
820f6e0902eb91bef054441dd380273b684407bdf224ae3dcfd30e87933beb50
|
|
MD5 |
2b2f08e3558160edbca1f33ae98d6686
|
|
BLAKE2b-256 |
be00132de17fe0f23c491a4db1ecd7dff77a7e5eee6ab99f7e182cfebb40e54a
|