Forum Discussion

cwkim_261931's avatar
cwkim_261931
Icon for Nimbostratus rankNimbostratus
Jun 02, 2018

How to use RestAPI(cURL)... Function of "LocalLB::Rule::get_description"

Hi,

 

I have poor skill RestAPI...

 

And I want to know how to use this function....."LocalLB::Rule::get_description"

 

To get my goal, I need the sample RestAPI(cURL) imported functions("LocalLB::Rule::get_description").

 

curl -sk -u admin:admin -H Content-Type: application/json -X GET -d '{?????????}'

 

Please help me.

 

BR~

 

2 Replies

  • You may want to consider using the Python SDK. In that case, 'description' is a property of any object that has one. For example:

    !/usr/bin/env python3
    
    from f5.bigip import ManagementRoot
    from getpass import getpass
    from pprint import pprint
    
    hostname = 'my.f5.ltm.net'
    username = 'foo'
    
    mgmt = ManagmentRoot(hostname, username, getpass())
    
    virtual = mgmt.tm.ltm.virtuals.virtual.load(
        partition='Common',
        name='my_virtual_server',
    )
    
    if hasattr(virtual, 'description'):
        print(virtual.description)
    else:
        print('Virtual server does not have a description.')