importnomad# For HTTP Nomad instancesn=nomad.Nomad(host="172.16.100.10", timeout=5)
# For HTTPS Nomad instances with non-self-signed SSL certificatesn=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 certn=nomad.Nomad(host="172.16.100.10", secure=True, timeout=5, verify=False)
# For HTTPS Nomad instances with self-signed SSL certificates that mus validate with certn=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 keyn=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 tokenn=nomad.Nomad(host="172.16.100.10", secure=Truetimeout=5, verify=False, namespace='Namespace-example',token='3f4a0fcd-7c42-773c-25db-2d31ba0c05fe')
"example" inn.jobsj=n.jobs["example"]["ID"]
example_allocation=n.job.get_allocations(j)
n.job.deregister_job(j)
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