Reply

How do I get the inheritance status of extensible attributes via WAPI?

New Member
Posts: 2
1411     0

I can see the "inheritance_source" if the extattr is inherited e.g.

[
{
"_ref": "record:host/ZG5zLmhvc3QkLm5vdl9ETlNfaG9zdF9yb290LjAuMTY2NjA0MTE4ODM0Ny50ZXN0OQ:test9/%20",
"extattrs": {
"tag1": {
"inheritance_source": {
"_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDEwLjAuMC4wLzgvM1:10.0.0.0/8/default"
},
"value": "value0"
}
},
"ipv4addrs": [
{
"_ref": "record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQubm9uX0ROU29ob3N0X3Jvb3QuMC4xNjY2MDQxMTg4MzQ3LnRlc3Q5LjEwLjAuMC45Lg:10.0.0.9/test9/%20",
"configure_for_dhcp": False,
"host": "test9",
"ipv4addr": "10.0.0.9"
}
],
"name": "test9",
"view": " "
}
]

However, I am unable to know the inheritance status if the value is overridden.

[
{
"_ref": "record:host/ZG5zLmhvc3QkLm5vdl9ETlNfaG9zdF9yb290LjAuMTY2NjA0MTE4ODM0Ny50ZXN0OQ:test9/%20",
"extattrs": {
"tag1": {
"value": "value1"
}
},
"ipv4addrs": [
{
"_ref": "record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQubm9uX0ROU29ob3N0X3Jvb3QuMC4xNjY2MDQxMTg4MzQ3LnRlc3Q5LjEwLjAuMC45Lg:10.0.0.9/test9/%20",
"configure_for_dhcp": False,
"host": "test9",
"ipv4addr": "10.0.0.9"
}
],
"name": "test9",
"view": " "
}
]  

I can see the "Inheritance State" in Extensible Attributes section via GUI, just wondering if there is a way to get the inhertiance state of a specific tag via WAPI?

Screen Shot 2022-10-24 at 21.24.49.png

 

Re: How do I get the inheritance status of extensible attributes via WAPI?

[ Edited ]
Moderator
Moderator
Posts: 321
1411     0

The inheritance state can be assumed.  If there is an attribute value with an inheritance source, then the value is inherited.  If there is an atribute value with no inheritance source, then the value is overridden.

Re: How do I get the inheritance status of extensible attributes via WAPI?

New Member
Posts: 2
1411     0

Hi MRichard,

 

Thank you for your reply, however I think if there is an attribute value with no inheritance source, then the value can be "Overridden" or "No Parent" depends on whether we set the attribute value on it's parent object.

 

I am wondering if there is an easy way to get the inheritance status without checking the parent object.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You