Skip to main content

Python client for DCI Control Server

Project description

# python-dciclient

## Installation

One should retrieve the package available at http://dci.enovance.com/dci-release.el7.noarch.rpm and install it.

Then simply run yum install python-dciclient.

## Example

```python
from dciclient.v1.api import context as dcicontext
from dciclient.v1.api import job as dcijob
from dciclient.v1.api import jobstate as dcijobstate
from dciclient.v1.api import file as dcifile

ctx = dcicontext.build_dci_context(
'http://127.0.0.1',
'your_account',
'your_password')

remoteci_id = 'e86ab5ba-695b-4337-a163-161e20b20f56'
job = dcijob.schedule(ctx, remoteci_id=remoteci_id).json()
job_full_data = dcijob.get_full_data(ctx, job_id)

dcijobstate.create(ctx, 'pre-run', 'Initializing the environment', job_id)
do_some_operations()

jobstate = dcijobstate.create(ctx, 'running', 'Running the test', job_id)
result == run_the_deployment(job_full_data)

with codecs.open('test.log', encoding='utf-8') as f:
content = f.read(20 * 1024 * 1024)
dcifile.create(ctx, 'to_send.log', content, 'text/plain', jobstate_id)

if result:
final_status = 'success'
else:
final_status = 'failure'

dcijobstate.create(ctx, final_status, 'Job has been proceeded.', job_id)
```

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

dciclient-0.1a1.tar.gz (26.3 kB view details)

Uploaded Source

File details

Details for the file dciclient-0.1a1.tar.gz.

File metadata

  • Download URL: dciclient-0.1a1.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dciclient-0.1a1.tar.gz
Algorithm Hash digest
SHA256 e1249aeca2fb310a998b9424c25add643021509913dabf149182cbcc616bf629
MD5 4a905116673a664dd3f9dced7669d6b8
BLAKE2b-256 30a0e423f971c2150ba53d5aed317169dd99ada01fe75a95d70efc18fc2795d0

See more details on using hashes here.

Supported by

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