Python API Client for Traffic Ops
Project description
- Introduction
This directory contains the Traffic Ops Python Client for Python 2.x and Python 3.x.
NOTE: This client has only been tested against Python 2.7 and Python 3.6. Other versions
may work, so, you mileage may vary.
- Installation
NOTE: Assuming in a already newly created and activated virtualenv
From github.com via pip:
# pip install git+https://github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python/trafficops"
or
# pip install git+ssh://git@github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python/trafficops"
Local Installation from cloned 'trafficcontrol' repository:
NOTE: 'trafficcontrol' => https://www.github.com/apache/trafficcontrol
NOTE: Assuming cd'd to the root of a forked/cloned 'trafficcontrol' repository
1. Activate your virtualenv environment (Python Virtual Environment)
E.g.
NOTE: Where <virtual environment directory> is, for example, '~/VENV/my_venv'.
$ source ~/VENV/my_venv/bin/activate
(my_venv) $
2. Install the software for the correct environment in the activated virtualenv
(my_venv) $ cd <root of 'trafficcontrol' repository>/traffic_control/clients/python/trafficops
(my_venv) $ python setup.py install
...
(my_venv) $ cd <root of 'trafficcontrol' repository>
3. Test Package is installed correctly
(my_venv) $ python
(my_venv) $ Python 3.6.1 (default, Apr 4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import trafficops
>>> dir(trafficops)
['LoginError', 'OperationError', 'RestApiSession', 'TOSession', '__builtins__', '__cached__',
'__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__',
'__version__', 'api_request', 'default_headers', 'restapi', 'tosession']
>>> tos = trafficops.TOSession(host_ip=u'to.somedomain.net', verify_cert=True)
>>> tos.login(u'someuser', u'someuser123')
>>> cdns, response = tos.get_cdns()
>>> exit()
(my_venv) $
NOTE: No errors/exceptions (warnings are okay) means you should be good to go.
This directory contains the Traffic Ops Python Client for Python 2.x and Python 3.x.
NOTE: This client has only been tested against Python 2.7 and Python 3.6. Other versions
may work, so, you mileage may vary.
- Installation
NOTE: Assuming in a already newly created and activated virtualenv
From github.com via pip:
# pip install git+https://github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python/trafficops"
or
# pip install git+ssh://git@github.com/apache/trafficcontrol.git#"egg=trafficops&subdirectory=traffic_control/clients/python/trafficops"
Local Installation from cloned 'trafficcontrol' repository:
NOTE: 'trafficcontrol' => https://www.github.com/apache/trafficcontrol
NOTE: Assuming cd'd to the root of a forked/cloned 'trafficcontrol' repository
1. Activate your virtualenv environment (Python Virtual Environment)
E.g.
NOTE: Where <virtual environment directory> is, for example, '~/VENV/my_venv'.
$ source ~/VENV/my_venv/bin/activate
(my_venv) $
2. Install the software for the correct environment in the activated virtualenv
(my_venv) $ cd <root of 'trafficcontrol' repository>/traffic_control/clients/python/trafficops
(my_venv) $ python setup.py install
...
(my_venv) $ cd <root of 'trafficcontrol' repository>
3. Test Package is installed correctly
(my_venv) $ python
(my_venv) $ Python 3.6.1 (default, Apr 4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import trafficops
>>> dir(trafficops)
['LoginError', 'OperationError', 'RestApiSession', 'TOSession', '__builtins__', '__cached__',
'__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__',
'__version__', 'api_request', 'default_headers', 'restapi', 'tosession']
>>> tos = trafficops.TOSession(host_ip=u'to.somedomain.net', verify_cert=True)
>>> tos.login(u'someuser', u'someuser123')
>>> cdns, response = tos.get_cdns()
>>> exit()
(my_venv) $
NOTE: No errors/exceptions (warnings are okay) means you should be good to go.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for Apache-TrafficControl-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be710457a9bbfab3c77062dc806129d562a63069d167c09ca77af813a89c0c7d |
|
MD5 | 887a0380f6c8f3310ede740daf911a30 |
|
BLAKE2b-256 | 7b744416ab157c7416aeca33bce7379c286865d342c78ba08fca5a06f3aa6126 |
Close
Hashes for Apache_TrafficControl-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c8cf4132d68b0b1d7bf853ae2ec5ecb3cf72341c09535ea0c40b4573f8ab1c |
|
MD5 | 9ee09fb0547feca5b47857cec77c95e5 |
|
BLAKE2b-256 | 0f436ba2b732a0f1f2d35eb9cd1de0947cdb72746a4f8d4b816f7ededc22c1e5 |
Close
Hashes for Apache_TrafficControl-0.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60b120cff037ec9b51889d858528f5fb94549b21eb00bd5bfc53e2f27d0f8099 |
|
MD5 | 0ba1a3f519388e7d0cd564abe7350215 |
|
BLAKE2b-256 | 0b573c1700026574eda377a097564c0cb5ab9da04e64d623b035bfc1c412655e |