Troubleshooting gvm-cli's create_report Command

Hi, I’m trying to use the create_report command with gvm-cli. The command structure is as follows: '<create_report><report id="f0fdf522-276d-4893-9274-fb8699dc2270" format_id="d5da9f67-8551-4e51-807b-b6a873d70e34" extension="xml" content_type="text/xml"><report id="f0fdf522-276d-4893-9274-fb8699dc2270"><gmp><version>21.4</version></gmp></report></report><task id="2d641773-2429-4d4a-8339-872a22d2c9c9"/></create_report>' However, I’m encountering the following error: ‘ERROR
Error 400. TASK must be a container.’ Can you please help me identify what I’m doing wrong?


IMHO you tried to import a report into a “normal” task. You need to use a container task. Therefore you need to take a look at your tasks or even maybe create a new container task and use the ID of a container task here.

1 Like

Thanks for help sir. I thought that by specifying the usage_type as “container”, I would be indicating the type of the task. However, it seems that only when I tried the container example of create_task from the forum:

<name>Container Example</name>
<comment>This task provides for importing reports</comment>
<target id="0"/>

and used its ID for create_report, it worked. How can I customize these settings? For example, why is the target_id set to 0 and why isn’t a config provided?