load(path: str) → Union[list[RESTObject], RESTObject]¶
Loads one object or a list of objects from the device. If you call with a specific object name, it returns a single object. If you call without an object name, it returns a list of objects.
Sends an HTTP GET request to the iControl REST API.
Parameters: path – HTTP path used in the HTTP request sent to the device.
- RESTAPIError: Raised when iControl REST API returns an error.
virtual = device.load("/mgmt/tm/ltm/virtual/bigrest_vs") virtuals = device.load("/mgmt/tm/ltm/virtual")
This will load one or multiple objects from the device.
If called with an object name, it will just return a single object.
If called without an object name, it will return a list with all object of that type.
The first line loads a single virtual server.
As the name of the virtual server was provided, we know it will only return a single object.
The last line will load all virtual servers from the device.
You can then use a “for” to loop thought the virtual servers one by one.