REST API for data-group json object fields
We are using the REST API to add, edit and remove internal data-group objects and I noticed an odd behavior in the json response that depends on the type of key/value being returned. Additional json fields are returned and the key is pulled into multiple fields.
Some examples... Normal response is from a datagroup that looks like this:ltm data-group internal /Common/test_datagroup {
records {
www.website.com {
data website_pool
}
}
json object response looks like this:
{
kind: "tm:ltm:data-group:internal:internalstate",
name: "test_datagroup",
partition: "Common",
fullPath: "/Common/test_datagroup",
generation: 34846,
selfLink: "https://localhost/mgmt/tm/ltm/data-group/internal/~Common~test_datagroup?ver=11.6.0",
type: "string",
records: [
{
name: "www.website.com",
data: "website_pool"
},
]
And now an example of what seems to be invalid:
ltm data-group internal /Common/test_datagroup2 {
records {
/website/path/ {
data website_pool
}
}
json object response looks like this:
{
kind: "tm:ltm:data-group:internal:internalstate",
name: "test_datagroup2",
partition: "Common",
fullPath: "/Common/test_datagroup2",
generation: 34896,
selfLink: "https://localhost/mgmt/tm/ltm/data-group/internal/~Common~test_datagroup2?ver=11.6.0",
type: "string",
records: [
{
name: "",
partition: "website"
subpath: "path"
data: "website_pool"
},
]
In the "invalid" example above the json response is adding the fields partition and subpath in the response and also striping the "/" characters. We have had to write our application to account for datagroups that start with a "/" and then read the values from partition and subpath fields and then pre and post pend the "/" ... this just seems like very odd behavior of the api and i would expect it to always return name and data fields everytime.
It also makes updating the datagroups more difficult because we have to then destruct back into this format in order to update the datagroups back to the bigip.
So, my question is... are we doing something wrong here? or is this a bug?