Forum Discussion

Rob_74473's avatar
Rob_74473
Icon for Cirrus rankCirrus
Sep 12, 2018

Trying to get rateLimitMode for virtual server through python sdk

I am trying to get the rateLimitMode from the python sdk. All I get is 'object'.

 

u'rateLimit': u'disabled', u'rateLimitDstMask': 0, u'rateLimitMode': u'object', u'rateLimitSrcMask': 0,

 

When I try to print virt.rateLimitMode.__dict__ I get 'unicode' doesn't have dict property, but any kind of printing as if rateLimitMode is Unicode I can only get 'object'.

 

How can I get the rateLimitMode string from this parameter?

 

3 Replies

  • 'object' is a string literal, meaning

    Per Virtual Server
    is selected in the
    Connection Rate Limit Mode
    field in the virtual server setting.

    K93017176: Overview of the Standard virtual server describes 7 available modes. Unfortunately, the mode names in the article and GUI are different from the ones in tmsh and iControl REST. For example, when

    Per Virtual Server
    is selected from the GUI, you get the following:

     tmsh list ltm virtual vs rate-limit-mode
    ltm virtual vs {
        rate-limit-mode object
    }
    

    Or

     curl -sku admin:admin https:///mgmt/tm/ltm/virtual/vs?\$select=rateLimitMode
    {
        "rateLimitMode": "object"    <<< string literal
    }
    

    Run

    tmsh help ltm virtual
    for the names in tmsh/iControl REST.

              rate-limit-mode [destination | object | object-destination |
                               object-source | object-source-destination | source |
                               source-destination]
    

    Cheers

  • You should be able to guess the mapping by reading "virtual server" as "object". Here's the complete mapping.

     

    tmsh GUI

     

    object Per Virtual Server

     

    object-source Per Virtual Server and Source Address

     

    object-destination Per Virtual Server and Destination Address

     

    object-source-destination Per Virtual Server, Destination, and Source Address

     

    source Per Source Address (All Rate Limiting Virtual Servers)

     

    destination Per Destination Address (All Rate Limiting Virtual Servers)

     

    source-destination Per Source and Destination Address (All Rate Limiting Virtual Servers)