Is there a direct API call to add/remove fixlets from baselines?

I need a way to remove superseded fixlets and add new fixlets to my baseline using bigfix API, there is a put call to modify the baseline’s xml: https://developer.bigfix.com/rest-api/api/baseline.html

Is there a better way than just directly manipulating the xml file? Like: add fixlet with <ID> to baseline with <ID> and delete fixlet with <ID> from baseline <ID>

Thanks

Negative; you need to GET the baseline; add/delete/modify whatever components you want; and then PUT the resulting baseline over the original one’s URL.

What you propose has too many edge cases to be reasonably implemented, I think -

  1. Should the new component come first, last, or somewhere in between? What if the baseline has multiple Component Groups, does that change things?
  2. What if the new component has no Default Action? Should we take the first Action?
  3. What if the component to be removed appeared multiple times in the Baseline? Should we remove every occurrence?

The only sort of thing where I think we could make some assumptions, is in resyncing the baseline; and we actually do have a resource for that, where you can GET a ‘synced’ version of the baseline as if you had hit ‘synchronize all components’ in the Console; and then you can PUT that sync’ed version back over the original.

1 Like