Forum Discussion
F5 SDK usage with ASM
import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
from import ManagementRoot
mgmt = ManagementRoot("70.60.207.94", "admin", "admin")
collection = mgmt.tm.asm.get_collection()
for anobject in collection:
print anobject
p_collections = mgmt.tm.asm.policies_s.get_collection() for p_object in p_collections:
print p_object.name
print p_object.id
print p_object.kind
print p_object.selfLink
print p_object.allowedResponseCodes
policy=mgmt.tm.asm.policies_s.policy.load(id=p_object.id)
I got the following results
{u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} {u'reference': {u'link': u''}} rest-api-07 pwlpR2LJzxplAjAR3lp10g tm:asm:policies:policystate [400, 401, 404, 407, 417, 503]
All is good so far.
The following REST API would pass the Request data for arguments. I am trying to figure out how to the equivalent (pass arguments) the using using the F5 SDK
https://{{big_ip_a_mgmt}}/mgmt/tm/asm/policies?ver=12.1.0 Request Data { "fullPath":"/Common/rest-api_12", "active":"true", "virtualServers":[], "enforcementMode": "transparent", "description":"none", "applicationLanguage":"utf-8", "policy-builder":"disabled", "learningMode":"manual", "stagingSettings": { "signatureStaging": true, "placeSignaturesInStaging": false, "enforcementReadinessPeriod": 7 } }
Recent Discussions
Related Content
* 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