python sdk
6 Topicsget virtual list based on vip/destination filter [request params]?
Hi folks and python developers, I am looking for a solution to a question. Currently I am using python sdk to get the list of the virtuals with filter option as partition and destination/vip? I have tried following things and unable to achieve that: virtuals = mgmt.tm.ltm.virtuals.get_collection(requests_params={ 'params': 'expandSubcollections=true&$filter=partition+eq+partition&$destination+eq+vip')} What I am trying to do is for a given device , partition, vip I want to get the list of the virtuals. s there a way to wild card for destination? articles i referred are: 1) https://devcentral.f5.com/s/articles/getting-started-with-the-python-sdk-part-4-working-with-request-parameters-31420 2) https://devcentral.f5.com/s/articles/demystifying-icontrol-rest-part-3-how-to-pass-query-parameters-and-tmsh-options 3)524Views0likes1Commenterror creating client SSL key and certificate [error: (01070712)unknown format or security type ]
HI, I am facing issue while trying to create the SSL client key and certificate. it giving me the following error: The error is thrown while attempting to create the key/certificate, mgmt.shared.file_transfer.uploads.upload_file(p_key) mgmt.shared.file_transfer.uploads.upload_file(p_cert) key_sourcepath = 'file:/var/config/rest/downloads/{0}'.format(key_name) key_obj = mgmt.tm.sys.file.ssl_keys.ssl_key.create_key(name=key_name,partition=partition, sourcePath=key_sourcepath) key_obj.update() cert_sourcepath = 'file:/var/config/rest/downloads/{0}'.format(certificate_name) cert_obj = mgmt.tm.sys.file.ssl_certs.ssl_cert.create(name=certificate_name, partition=partition, sourcePath=cert_sourcepath) cert_obj.update() Text: '{"code":400,"message":"01070712:3: Certificate/Key has unknown format or security type (/Common/keynameAkash.key).","errorStack":[],"apiError":3}' ref: https://f5-sdk.readthedocs.io/en/latest/userguide/transactions.html ref: https://github.com/f5devcentral/lets-encrypt-python/blob/master/le_hook.py766Views0likes0CommentsSet Protocol Profile (Server) And HTTP Profile (Server) via the SDK
I am trying to set the Protocol Profile (Server) and the HTTP Profile (Server) via the Python SDK. I am putting the profiles I want in a dictionary object. profiles = { "profiles": [ "f5-tcp-lan", "f5-tcp-progressive", "http_x_forward_for", "custom", "clientssl", "serverssl" ] } ######THE ABOVE VALUES ARE IN THIS ORDER##### #PROTOCOL PROFILE (Client) #PROTOCOL PROFILE (Server) #HTTP PROFILE (Client) #HTTP PROFILE (Server) #SSL Profile (Client) #SSL Profile (Server) ########################################## BIGIP_CONN=ManagementRoot("1.1.1.1","admin","123") vip=BIGIP_CONN.tm.ltm.virtuals.get_collection()[1] vip.update(**profiles) When I do this I get the following error: iControlUnexpectedHTTPError: 400 Unexpected Error: Bad Request for uri: https://labf52:443/mgmt/tm/ltm/virtual/~Common~myvipname/ Text: '{"code":400,"message":"01070097:3: Virtual server /Common/myvipname lists duplicate profiles.","errorStack":[],"apiError":3}' Even if I put the VIP at all defaults with none of these profiles it still throws the error473Views0likes2CommentsHow to get the list of VIP Name, IP & Its Client SSL profile using Python SDK?
I am trying to get a list of Client SSL Profile configured to each VIP using Python SDK. I could able to gather information upto VIP name and IP, but looks like getting SSL profile attached to is not straight forward. I need to do this using script as i have nearly 40+ Load Balancers with nearly 100 VIPs in each. from f5.bigip import ManagementRoot import getpass user = input("Username:") password = getpass.getpass("Password:") f5_ip = '10.1.1.1' partition = 'Common' mgmt = ManagementRoot(f5_ip, user, password) ltm = mgmt.tm.ltm for virtual in virtuals: print("VS {} IP {} Profile {}".format(virtual.name, virtual.destination, virtual.profilesReference) ltm virtual ABC_VIP_443 { destination 10.2.2.2:https ip-protocol tcp mask 255.255.255.255 pool ABC_Pool_8443 profiles { serverssl { context serverside } wild_ABC_com { context clientside }979Views0likes1CommentDifferent Get requests
I want to know what is different between these two get request in icontrol rest. mgmt/tm/cloud/ltm/virtual-servers...& mgmt/tm/ltm/virtual-servers i am able to see it gives little different information. I have one lab f5 device which is runnning on 11.5.1 and it only works with Could version of get request. why is so that and how to utilize this in Python SDK. please help soon i have projects to deliver to automate F5.168Views0likes0Comments