Skip to main content

The Python SDK for Digital.ai Deploy

Project description

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 .

Project details


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.21.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xldeploy_py-0.0.21-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file xldeploy_py-0.0.21.tar.gz.

File metadata

  • Download URL: xldeploy_py-0.0.21.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for xldeploy_py-0.0.21.tar.gz
Algorithm Hash digest
SHA256 eae9415235c25340acc800678e9c8b5fe0cdd92a8a29ca82f84ac2b310b116b4
MD5 22f70d15cb5f354163bd3e819d630ec0
BLAKE2b-256 88a8314fd56dca325f9e647a1f46bb925a84d6b5ed87dda04f12584bf8f16824

See more details on using hashes here.

File details

Details for the file xldeploy_py-0.0.21-py3-none-any.whl.

File metadata

  • Download URL: xldeploy_py-0.0.21-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for xldeploy_py-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 466ed1bf17c076407fc582d2077bc9961655da0d374575eb5b0751a5061101ce
MD5 4070e2e7e39e0378b700ccf97e2f5873
BLAKE2b-256 95cd0e60b4aa77f33e5a06a3e8983f1351cbb2f9156398b2ad8a7a71483bea0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page