Skip to main content

xldeploy-py

Python SDK for Digital.ai 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")

# If you are using PAT (Personal Access Token) authentication
config = xldeploy.Config(protocol="http", host="localhost", port="4516", context_path="deployit", token="dpa_xxxxx", authentication_method="pat")

# 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 .

Release files for xldeploy-py 0.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xldeploy-py 0.0.22
File Size Uploaded
xldeploy_py-0.0.22.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xldeploy-py 0.0.22
File Interpreter ABI Platform
xldeploy_py-0.0.22-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / xldeploy_py-0.0.22.tar.gz

Download URL xldeploy_py-0.0.22.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
74e5dbfb847a4c1bd4ca41236d802a8636482006de2a6de6532ce8d53898d375
BLAKE2b-256 checksum
How to use checksums
db387c6bcbe1764810986e2500ca0536f35e87a2728f6139575dd99320e0671c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / xldeploy_py-0.0.22-py3-none-any.whl

Download URL xldeploy_py-0.0.22-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
712898cca609d57ac8ca99fccbba1460bded13dfab9a7aee90755506b74c63a7
BLAKE2b-256 checksum
How to use checksums
8345a3acd89f0424b7ad37b620409a87b0b7ae455095a0de150ddabeccf857a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.22 This release

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page