exist

Code

BIGIP.exist(path: str) bool

Verifies if the object exists on the device.

Sends an HTTP GET request to the iControl REST API.

Parameters:

path – HTTP path used in the HTTP request sent to the device.

Exceptions:

RESTAPIError: Raised when iControl REST API returns an error.

Example

if device.exist(f"/mgmt/tm/ltm/virtual/{rest_format("/bigrest/bigrest_vs")}"):
    print(f"Virtual server exists.")
else:
    print(f"Virtual server does not exist.")

Explanation

Verifies if the object exists.
In this example, verifies if virtual server “/bigrest/bigrest_vs” exists on the device.