create

Code

BIGIQ.create(path: str, data: dict) → bigrest.common.restobject.RESTObject

Creates the object on the device.

Sends an HTTP POST request to the iControl REST API.

Parameters:
  • path – HTTP path used in the HTTP request sent to the device.
  • data – Payload that will be sent to the device.
Exceptions:
RESTAPIError: Raised when iControl REST API returns an error.

Example

path = (
    "/mgmt/shared/resolver/device-groups/cm-adccore-allbigipDevices/devices"
    "?$filter=hostname eq 'LABBIGIP1.lab.local'"
)
device_link = device.link(path)
data = {
    "partition": "Common",
    "name": "172.17.0.1",
    "address": "172.17.0.1",
    "deviceReference": {
        "link": device_link
    }
}
device.create("/mgmt/cm/adc-core/working-config/ltm/node", data)

Explanation

This will create a node on the device.
You create a dictionary with the properties of the new object and pass that to the create method.
The system will use the default settings for any properties not specified.