Familiarizing yourself with the following underlying basic concepts will help you get up and running with the SDK.
You can directly infer REST URIs from the python expressions, and vice versa.
Examples
Expression: mgmt = ManagementRoot('<ip_address>', '<username>', '<password>')
URI Returned: https://<ip_address>/mgmt/
Expression: cm = mgmt.cm('<ip_address>', '<username>', '<password>')
URI Returned: https://<ip_address>/mgmt/cm
Expression: tm = mgmt.tm('<ip_address>', '<username>', '<password>')
URI Returned: https://<ip_address>/mgmt/tm
Expression: ltm = mgmt.tm.ltm('<ip_address>', '<username>', '<password>')
URI Returned: https://<ip_address>/mgmt/tm/ltm/
Expression: pools1 = mgmt.tm.ltm.pools
URI Returned: https://<ip_address>/mgmt/tm/ltm/pool
Expression: pool_a = pools1.create(partition="Common", name="foo")
URI Returned: https://<ip_address>/mgmt/tm/ltm/pool/~Common~foo
A set of basic REST endpoints can be derived from the object's URI and kind
(listed below).
The python object's attribute can be created dynamically based on the JSON returned when querying the REST API.
Almost all iControl® REST API entries contain a parameter named kind
. This parameter provides information about the object that lets you know what you should expect to follow it. The iControl® REST API uses three types of kind
: collectionstate
, state
, and stats
.
kind |
Associated Objects | Methods |
---|---|---|
collectionstate |
, | |
state |
, , , , , | |
stats |
, , |
Method | HTTP Command | Action(s) |
---|---|---|
POST | creates a new resource on the device with its own URI |
|
PUT | submits a new configuration to the device resource; sets the Resource attributes to the state reported by the device |
|
PATCH | submits a new configuration to the device resource; sets only the attributes specified in modify method. This is different from update because update will change all the attributes, not only the ones that you specify. |
|
GET | obtains the state of a device resource; sets the representing Python Resource Object; tracks device state via its attributes |
|
DELETE | removes the resource from the device, sets self.__dict__ to {'deleted': True} |
|
GET | obtains the state of an existing resource on the device; sets the Resource attributes to match that state |
|
GET | checks for the existence of an object on the BIG-IP® |
Note
Available methods are restricted according to the object's kind
.