Forum Discussion
Zdenda
Cirrus
Jun 15, 2015Best choice for automation
Hi,
have been playing with automation for a while and so far I've been using excel templates generating tmsh codes I need.
Lately I started to play with iControl REST and my excel generates API comma...
Greg_Robinson_1
Cirrus
Jul 23, 2015Python was easiest for me. Look how simple this is:
!/usr/bin/python3.4
import requests,json
def provisionSoftwareModule(ipAddress,verifyHttpsCert,userName,password,moduleName,provisioningLevel):
payload = {}
payload['name'] = moduleName
payload['level'] = provisioningLevel
apiCall = requests.session()
apiCall.auth = (userName, password)
apiCall.verify = verifyHttpsCert
apiCall.headers.update({'Content-Type' : 'application/json'})
apiUrl = 'https://' + ipAddress + '/mgmt/tm/sys/provision/' + moduleName
apiResponse = apiCall.put(apiUrl,data=json.dumps(payload))
if not '"generation"' in apiResponse.text:
print(apiResponse.text)
provisionSoftwareModule('192.168.1.1',False,'admin','mypassword','ltm','nominal')
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects