New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create FQDN Node using SDK #1487
Comments
So we need to support the exclusive attributes of address or fqdn on create. It doesn't appear I can update a node via REST, is that your experience? |
I haven't actually tried that myself with REST directly, so I'm not sure. I submitted a case to F5 support with this issue--and they led me here. This was their consensus: "Engineering Services notes that the Python SDK is expecting address to be set to "any6" when configuring a fqdn node." |
If I set it at all when using fqdn I get an error. I'll work on this this weekend |
it's definitely possible currently as shown below, but a little wonky since the SDK requires the address but the REST API does not:
It looks like all we have to do is require either address or fqdn to make the experience better. But for now, there is a workaround. |
To clarify from the larger message above, the way you can create the fqdn node with the sdk is to provide the address as any6 in addition to specifying the fqdn:
|
I've updated node resource to only allow address or fqdn, and resulting successes with one or the other and then the error when both are supplied will look like this:
Acceptable? If so, I'll get tests written for this change this weekend and submit PR |
Problem: SDK requires address parameter with Node, but the REST API does not require it for fqdn type nodes Solution: This PR looks for a set of required parameters that exclusively permits the fqdn or the address for the create method. Files Changed: - f5/bigip/tm/ltm/node.py (changed) - f5/bigip/tm/ltm/test/functional/test_node.py (changed)
Yes, that is exactly what I was looking for! |
* Issue #1487 - Fix issue with Node FQDN required parameters Problem: SDK requires address parameter with Node, but the REST API does not require it for fqdn type nodes Solution: This PR looks for a set of required parameters that exclusively permits the fqdn or the address for the create method. Files Changed: - f5/bigip/tm/ltm/node.py (changed) - f5/bigip/tm/ltm/test/functional/test_node.py (changed) * Issue #1487 - removed pytest-xdist as test requirement
This has been merged to development and will be in the next dot release. Closing issue. |
When I use the following code to create a node on the F5:
from f5.bigip import ManagementRoot
mgmt = ManagementRoot(big_ip, big_ip_user, big_ip_pass)
ltm = mgmt.tm.ltm
ltm.nodes.node.create(partition="Common", name="192.168.10.10", description="Created by Python")
I get the following error:
f5.sdk_exception.MissingRequiredCreationParameter: Missing required params: ['address']
However in the iControl API reference (https://devcentral.f5.com/Wiki/iControlREST.APIRef_tm_ltm_node.ashx) it states that the 'address' parameter is optional; "IP address of the node. This is an optional field; if empty, the name needs to be of the form ip address".
When I try to create an FQDN node with the Python SDK, i.e.:
ltm.nodes.node.create(partition="Common", name="fqdnnode.test", description="Created by Python", fqdn={'addressFamily': 'ipv4', 'downInterval': '5', 'interval': '3600', 'tmName': arg.lower()}))
It looks for the 'address' parameter--when I don't provide it, I get this error:
f5.sdk_exception.MissingRequiredCreationParameter: Missing required params: ['address']
This is a problem because even if I force my code to provide an FQDN as the 'address' the SDK won't let me because it checks that it's an IP address or not:
icontrol.exceptions.iControlUnexpectedHTTPError: 400 Unexpected Error: Bad Request for uri: https://10.23.129.132:443/mgmt/tm/ltm/node/
Text: '{"code":400,"message":"Invalid IP address: \"testnode.test\"","errorStack":[],"apiError":26214401}'
So basically I can't create an FQDN node with the Python SDK, or create an IPv4 node without providing both the name and address parameters.
The text was updated successfully, but these errors were encountered: