Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

Attach SSL Profile to a VS with Python SDK

Hi,

I'm banging my head how to assign an existing ssl profile to an existing VS. Tried various ways but non of them worked. I always receive an error message like that:

Client SSL profile (/Common/my_client_ssl): cert-key-chain and profile cert, key or chain options cannot be specified together.","errorStack":[],"apiError":2}'

Here is one of my tries using transaction:

s1 = b_mg.tm.transactions.transaction

   with TransactionContextManager(s1) as api1:
      vs2 = api1.tm.ltm.virtuals.virtual.load(name=my_vs, partition=b_part)
        ssl_prof = api1.tm.ltm.profile.client_ssls.client_ssl.load(name=my_client_ssl,partition=b_part)
        api1.vs2 = ssl_prof
        api1.vs2.profiles_s.update()

I would really like to know how to do it right,

Thanks,

Alex

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

try below, was tested on 12.1.3

>>> import requests
>>> requests.packages.urllib3.disable_warnings()
>>> from f5.bigip import ManagementRoot
>>> b = ManagementRoot('x.x.x.x', 'admin', 'admin', token=True)
>>> virtual = b.tm.ltm.virtuals.virtual.load(partition='Common', name='ubuntu_apache_HTTPS')
>>> p = virtual.profiles_s.profiles.create(partition='Common', name='ubunutu_clientssl')
2
Comments on this Answer
Comment made 24-Jun-2018 by Alex.Nimo 145

Creating a new profile works fine but I need to attach an existing profile.

0
Comment made 25-Jun-2018 by Anesh 910

The above code works for an existing profile

0
Comment made 26-Jun-2018 by Alex.Nimo 145

Indeed it works! I would never thought using create method.... makes no sense to me. Thanks a lot Anesh, I appreciate your help

0