Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Use the CMDB v3 /items/system endpoint #6

Merged
merged 2 commits into from
Apr 27, 2017
Merged

Use the CMDB v3 /items/system endpoint #6

merged 2 commits into from
Apr 27, 2017

Conversation

rowanmanning
Copy link
Member

We've had to switch endpoints for the move from v2 to v3 of CMDB. The intention is to support filtering in the URL at a later date which may mean we can increase the per-page limit and only request the data we need.

@rowanmanning
Copy link
Member Author

@GeoffThorpeFT, not sure if you want to look over this

// We're only interested in system codes
return response.body
.filter(entry => entry.systemCode)
.map(entry => entry.systemCode);
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the above is aiming to extract just the field named "systemCode" from the rather long list of fields returned by the v3/items/system call. However, due to a legacy issue with data uploads (too long to explain) the systemcode is actually held in the key field "dataItemID" not "systemCode". You may find some "systemCode" fields but its no longer used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks Geoff! Glad I asked :) will change

{value: 'bar'}
{systemCode: 'foo'},
{noSystemCode: 'this should not appear'},
{systemCode: 'bar'}
]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to above issue with the "systemCode" field I recommend changing these mockups to populate "dataItemID" since that is the real system code field.

As @GeoffThorpeFT mentioned, systemCode is no longer used. We now get a
more complete list of codes by using dataItemId.
@rowanmanning rowanmanning merged commit 8426b94 into master Apr 27, 2017
@rowanmanning rowanmanning deleted the use-cmdb-v3 branch April 27, 2017 13:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants