Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Jason Rahm, Sr. Solution Architect
Tim Rupp, Sr. Software Engineer
May 2008:pyControl v1
Dec 2009: pyControl v2
Nov 2012: bigsuds
Mar 2016: f5-common-python
•
•
•
•
•
1. Break the cycle• Another Engineer, another SDK. No more SDKs• Act as a layer of abstraction to fix what cannot, or will not, be fixed• Convention convention convention
2. Integrate seamlessly across the entire product line• BIG-IP• BIG-IQ• iWorkflow
3. Meet the new expectations of the customer that have been brought about by the cloud
•••••
• Small team with limited resources• Large code-bases and hundreds of customers• Automated test infrastructure to watch Pull Requests (PRs)• Chat bots to provide notifications and feedback
Conventions• Limit the self-commits. Strive to eliminate them• Identify patterns in code to make development more rapid• Stick to coding conventions to eliminate developer ramp-up time
nd functional tests• All major releases 11.5.4 to present • Code coverage• ReadTheDocs documentation• Slack channels for quick communication
Tooling• tox, pytest, OpenStack heat, Jenkins Pipeline, Hubot, Github and Gitswarm• Coding conventions, Python, examples and real product used by real customers
•••• Named• Unnamed
••
ManagementRoot tmcm...
ltmgtmasmnetsys...
authpoolsvirtualsvirtual_address_s
create load update
virtualpolicies_sprofiles_srules
policies
deletecreate load update delete
Pythonmgmt = ManagementRoot(‘localhost’, ‘admin’, ‘admin’)virtual = mgmt.tm.ltm.virtuals.virtual.create(
name=‘my-virt’, destination=‘10.10.10.10:443’)
HTTPPOST http://localhost/mgmt/tm/ltm/virtual/{”name”: “my-virt”,“destination”: “10.10.10.10:443”
}
Becomes
Method HTTP Command Actioncreate() POST Creates a new resource on the device with its own URI
exec_cmd() POST Used to run commandsupdate() PUT Submits a new configuration for the device resource; sets the
resource attributes to the state reported by the devicemodify(**kwargs) PATCH Submits a new configuration to the device resource; sets only
the attributes specified in kwargsget_collection() GET Gets the resources in a collection
refresh() GET Obtains the state of a device resource; sets the representing python resource object; tracks device state via its attributes
load() GET Obtains the state of an existing resource on the device; sets the python resource object attributes to match that state
exists() GET Checks for the existence of an object on the devicedelete() DELETE Removes the resource from the device
MACDADDY:~ rahim$ virtualenv venvNew python executable in venv/bin/pythonInstalling setuptools, pip, wheel...done.MACDADDY:~ rahim$ . venv/bin/activate(venv)MACDADDY:venv rahim$ pip install f5-sdk...Successfully installed f5-icontrol-rest-1.3.0 f5-sdk-2.3.1 requests-2.13.0 six-1.10.0(venv)MACDADDY:venv rahim$ pythonPython 2.7.10 …>>> from f5.bigip import ManagementRoot>>> b = ManagementRoot('ltm3.test.local', 'admin', 'admin')>>>>>> b = ManagementRoot('ltm3.test.local', 'admin', 'admin', token=True)>>>
• https://github.com/F5Networks/f5-common-python
Slack• f5-common-python.slack.com
••••••
••••
Follow us on Twitter and use the #F5Agility17 hashtag!