Forum Discussion

genius8237_3216's avatar
genius8237_3216
Icon for Nimbostratus rankNimbostratus
Aug 21, 2015

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?

2 Replies

  • It's probably another bug in iControlREST. Which version are you running? I suggest to make a try with latest (v11.6 HF5) and if same result, open a case by F5 support. If you do so and receive the BUGID, please share it here (would be happy to open myself a support case and have it linked to that BUGID).

     

    Alex

     

  • lparks_207774's avatar
    lparks_207774
    Historic F5 Account

    This is indeed a tracked bug for anyone else that was curious: ID527094