BigFix REST API to import items of different category

Can I use bigfix REST API to import items of different category like Fixlets, Baseline and Computer Groups

Provided I have .bes file of following format:
<BES>
<Fixlet>

</Fixlet>
<Baseline>

</Baseline>
</BES>

Yes, you can use the REST API or the IEM CLI to import .bes object into a site. To import an object (fixlet, action…) you can use the “import” API. Following are examples of import thru the IEM CLI.

To import a fixlet into the master site use the following:
iem post /TEM/fixlet_1.xml import/master

To import a fixlet to a custom site (Fabio) use the following:
./iem post /TEM/fixlet_1.xml import/custom/Fabio

To be more precise on the above example, the xml file can be any “.bes” file obtained from an exported object, as shown in the following example:

iem.exe post /TEM/AIX_runasuser.bes import/master

Thanks for the information!!

I was trying to import the .bes file via python code using REST calls
I think issue is that I need to call specific api for import.
api = https://<Iemserver>:<Iemport>/api/<fixlettype>/<Iemsitename>

So here fixlettype matters. Like if I set fixlettype =“tasks” only Task from the .bes file will be imported. If I change fixlettype=“baselines” then only Baseline will get imported to IEMServer.

I wanted to know is there any other way to import whole .xml or .bes using python code (Is there any such REST resource that I need to call) ?

OR am I doing it in a correct way. (Making separate import calls for each type of item that I want to import) ?

I am not sure about your question, however, if you use the REST API “import/site” It will iport whatever is in the .bes file into the specified site. For example to import a .bes object into the “master action silte” you will use the REST API: post <file.bes> import/master

1 Like

Thanks a lot. I missed this resource of import

It solved my problem.