- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Using inheritance_operation within extattrs
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-10-2017 03:40 AM
Hi
Im trying to use the wapi to create host records that inherits extensible attributes from the network, but im getting errors.
I'll post the script i'v been working on so far.
POST https://example.test.com/wapi/v2.2.2/record:host
Content-Type application/json
{
"name": "test01",
"configure_for_dns": false,
"extattrs": {
"Purpose": {"value": "Testing WAPI"},
"VLAN#":{"value": "1000"},
"Zone": {
"inheritance_source": "network/ZG5zLm5ldHdvcmskMS4xLjEuMC8yNC8w:1.1.1.0/24/default",
"inheritance_operation": "INHERIT",
"descendants_action": {
"option_with_ea": "RETAIN"
}
}
},
"ipv4addrs": [
{
"ipv4addr": {
"_object_function": "next_available_ip",
"_object": "network",
"_object_parameters": {"network": "1.1.1.0/24"},
"_result_field": "ips",
"_parameters": {
"num": 1
}
}
}
]
}
Im getting these errors.
{
"Error": "AdmConDataError: None (IBDataConflictError: IB.Data.Conflict:Cannot apply 'INHERIT' operation. There's no any extensible attribute of '.Zone' on parent object.)",
"code": "Client.Ibap.Data.Conflict",
"text": "Cannot apply 'INHERIT' operation. There's no any extensible attribute of '.Zone' on parent object."
}
My problem seems to be that the system doesn't recognize that the network(parent) has a value in the extensible attribute, Zone.
However if i create a host manually within the network 1.1.1.0/24 the record inherits the extensible attributes without any problems.
My question is then. Is it even possible to do the operation I want to do ? And im I using the correct object to do so ?
Thanks in advance.
Regards
Kasper Brix
Re: Using inheritance_operation within extattrs
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-27-2017 01:08 AM
To inherit when using host the below is needed.
use_for_ea_inheritance
Set this to True when using this host address for EA inheritance.
Type
Bool.
Create
The default value is False.
Search
The field is not searchable.
Example:
{"name": "onehostrecordplease", "configure_for_dns": false, "extattrs": {"Inheritme": {"inheritance_operation": "INHERIT"}}, "ipv4addrs": [{"use_for_ea_inheritance": true, "ipv4addr":{"_object_function": "next_available_ip", "_object": "network", "_object_parameters": {"network": "10.61.5.0/24"}, "_result_field": "ips", "_parameters": {"num": 1}}}]}
Best regards,
Christian