Unnamed Resource¶
An unnamed resource is a partially configurable object for which the CURDLE methods are supported with the exception of the create and delete methods.
In the F5® SDK, an unnamed resource is instantiated via its collection. Once loaded, unnamed resources contain attributes that map to the JSON fields returned by the BIG-IP®.
Example: Load a f5.bigip.tm.sys.dns
UnnamedResource
object.
>>> from f5.bigip import ManagementRoot
>>> mgmt = ManagementRoot('192.168.1.1', 'admin', 'admin')
>>> dns = mgmt.tm.sys.dns.load()
>>> pp(dns.raw)
{
u'description': u'configured-by-dhcp',
u'kind': u'tm:sys:dns:dnsstate',
u'nameServers': [u'10.10.10.1', u'8.8.8.8'],
u'numberOfDots': 0,
u'search': [u'localdomain', u'test.local'],
u'selfLink': u'https://localhost/mgmt/tm/sys/dns?ver=13.1.0.1'
}
The output of the f5.bigip.tm.sys.dns
(above) shows all of the available attributes.
Once you have loaded the object, you can access the attributes as shown below.
dns.nameServers = ['2.2.2.2', '3.3.3.3']
dns.update()