All Projects β†’ jrxFive β†’ Python Nomad

jrxFive / Python Nomad

Licence: mit
Client library Hashicorp Nomad

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Nomad

Hvac
πŸ”’ Python 2.7/3.X client for HashiCorp Vault
Stars: ✭ 839 (+832.22%)
Mutual labels:  api, hashicorp, client
Sherpa
Sherpa is a highly available, fast, and flexible horizontal job scaling for HashiCorp Nomad. It is capable of running in a number of different modes to suit different requirements, and can scale based on Nomad resource metrics or external sources.
Stars: ✭ 165 (+83.33%)
Mutual labels:  api, hashicorp, nomad
Node Vault
Client for HashiCorp's Vault
Stars: ✭ 391 (+334.44%)
Mutual labels:  api, hashicorp, client
Sechub
SecHub - one central and easy way to use different security tools with one API/Client
Stars: ✭ 52 (-42.22%)
Mutual labels:  api, client
Gochimp3
πŸ’ Golang client for MailChimp API 3.0.
Stars: ✭ 39 (-56.67%)
Mutual labels:  api, client
Nineapi
Unofficial python client library for *official* 9GAG API. (alpha)
Stars: ✭ 43 (-52.22%)
Mutual labels:  api, client
Trek
Trek is a CLI/ncurses explorer for HashiCorp Nomad clusters.
Stars: ✭ 26 (-71.11%)
Mutual labels:  hashicorp, nomad
Hashi Ui
A modern user interface for @hashicorp Consul & Nomad
Stars: ✭ 1,119 (+1143.33%)
Mutual labels:  hashicorp, nomad
Dsc Mercado Livre
Biblioteca de integração com o Mercado Livre
Stars: ✭ 55 (-38.89%)
Mutual labels:  api, client
Fredr
An R client for the Federal Reserve Economic Data (FRED) API
Stars: ✭ 61 (-32.22%)
Mutual labels:  api, client
Cups Ipp
CUPS Implementation of IPP - PHP Client API
Stars: ✭ 70 (-22.22%)
Mutual labels:  api, client
Vainglory
(*DEPRECATED*: The API no longer exists, so this will no longer work) A Javascript API Client wrapper for Vainglory
Stars: ✭ 32 (-64.44%)
Mutual labels:  api, client
Gitter Api
[production-ready] Gitter API implementation for php 7.0+ allowing sync, async and streaming access.
Stars: ✭ 11 (-87.78%)
Mutual labels:  api, client
Https
Secure HTTP client with SSL pinning for Nativescript - iOS/Android
Stars: ✭ 45 (-50%)
Mutual labels:  api, client
Dimscord
A Discord Bot & REST Library for Nim.
Stars: ✭ 67 (-25.56%)
Mutual labels:  api, client
Uploadcare Php
PHP API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Stars: ✭ 77 (-14.44%)
Mutual labels:  api, client
Adrestia
APIs & SDK for interacting with Cardano.
Stars: ✭ 56 (-37.78%)
Mutual labels:  api, client
Nomadfiles
A collection of Nomad job files for deploying applications to a cluster
Stars: ✭ 89 (-1.11%)
Mutual labels:  hashicorp, nomad
Instagram Web Api
🀳 Instagram Private Web API client for Node
Stars: ✭ 694 (+671.11%)
Mutual labels:  api, client
Swaddle
Automagically create API clients/wrappers in JavaScript
Stars: ✭ 23 (-74.44%)
Mutual labels:  api, client

python-nomad

Branch Status Coverage
master Build Status codecov

Installation

pip install python-nomad

Documentation

https://python-nomad.readthedocs.io/en/latest/

Examples

import nomad
# For HTTP Nomad instances
n = nomad.Nomad(host="172.16.100.10", timeout=5)

# For HTTPS Nomad instances with non-self-signed SSL certificates
n = nomad.Nomad(host="172.16.100.10", secure=True, timeout=5, verify=True)

# For HTTPS Nomad instances with self-signed SSL certificates and no validate the cert
n = nomad.Nomad(host="172.16.100.10", secure=True, timeout=5, verify=False)

# For HTTPS Nomad instances with self-signed SSL certificates that must validate with cert
n = nomad.Nomad(host="172.16.100.10", secure=True, timeout=5, verify=True, cert="/path/to/certfile") # See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification

# For HTTPS Nomad instances with cert file and key
n = nomad.Nomad(host="https://172.16.100.10", secure=True, timeout=5, verify=True, cert=("/path/to/certfile", "/path/to/key")) # See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification

# For HTTPS Nomad instances with namespace and acl token
n = nomad.Nomad(host="172.16.100.10", secure=True, timeout=5, verify=False, namespace='Namespace-example',token='3f4a0fcd-7c42-773c-25db-2d31ba0c05fe')

"example" in n.jobs

j = n.jobs["example"]["ID"]

example_allocation = n.job.get_allocations(j)

n.job.deregister_job(j)

Environment Variables

This library also supports environment variables: NOMAD_ADDR, NOMAD_NAMESPACE, NOMAD_TOKEN, NOMAD_REGION, NOMAD_CLIENT_CERT, and NOMAD_CLIENT_KEY for ease of configuration and unifying with nomad cli tools and other libraries.

NOMAD_ADDR=http://127.0.0.1:4646
NOMAD_NAMESPACE=default
NOMAD_TOKEN=xxxx-xxxx-xxxx-xxxx
NOMAD_REGION=us-east-1a
NOMAD_CLIENT_CERT=/path/to/tls/client.crt
NOMAD_CLIENT_KEY=/path/to/tls/client.key

Class Dunders

Class contains len getitem iter
agent N N N N
allocation Y N Y N
allocations N Y N Y
client N N N N
evaluation Y N Y N
evaluations Y Y Y Y
job Y N Y N
jobs Y Y Y Y
node Y N Y N
nodes Y Y Y Y
regions Y Y Y Y
status.leader Y Y N N
status.peers Y Y Y Y
system N N N N
validate N N N N
deployments Y Y Y Y
deployment Y N Y N
namespace Y N Y N
namespaces Y Y Y Y
acl Y N Y N
sentinel Y N Y N

Development

  • create virtualenv and activate
  • install requirements-dev.txt
  • can either use the Vagrantfile for local integration testing or create environment variables NOMAD_IP and NOMAD_PORT that are assigned to a nomad binary that is running
virutalenv venv
source venv/bin/activate
pip install -r requirements-dev.txt

Testing with vagrant and virtualbox

vagrant up --provider virtualbox
py.test --cov=nomad --cov-report=term-missing --runxfail tests/

Testing with nomad binary

./nomad agent -dev -node pynomad1 --acl-enabled
NOMAD_IP=127.0.0.1 NOMAD_VERSION=<SEMNATIC_VERSION> py.test --cov=nomad --cov-report=term-missing --runxfail tests/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].