Description of problem: While there is an API call to begin scans via SmartState for Virtual Machines (http://manageiq.org/docs/reference/latest/api/reference/vms), there is no API call to do so with containers despite being able to be invoked from the UI. As a workaround, the container can be directly queried for SmartState Analysis via the console like so: image = ContainerImage.find_by(:id => id_value) ; image.scan() However, API access is more desirable for obvious reasons (remote access, etc). Version-Release number of selected component (if applicable): Latest/any version of CFME or MIQ Additional info: This was opened as a Request for Feature Enhancement by our own internal Red Hat IT Team, which desires this feature for management of containers.
CFME Version: 5.10.0.16.20180919151347_a0c9e02 Verification steps using miq-rest-api-client-python: #get the provider crud object ocp = providers.get_crud('ocp-39-hawk') # Get the REST Entity image = ocp.appliance.rest_api.collections.container_images.get(name='dotnet/dotnet-20-runtime-rhel7') image Out[16]: <Entity u'https://10.8.197.248/api/container_images/150'> #verified the entity has the scan action: image.action.all Out[5]: [u'scan'] #Initiated the SmartState Analysis Scan image.action.scan() Out[4]: <Entity u'https://10.8.197.248/api/container_images/150' #Verified the scan was successfull ocp.appliance.rest_api.collections.tasks.all [<Entity u'https://10.8.197.248/api/tasks/27'>] task = ocp.appliance.rest_api.collections.tasks.get(id='27') task <Entity u'https://10.8.197.248/api/tasks/27'> task.name u"Container Image Analysis: 'dotnet/dotnet-20-runtime-rhel7'" task.state u'Finished' task.status u'Ok' #Verified the 'last scan attempt on' image.last_scan_attempt_on datetime.datetime(2018, 9, 24, 17, 31, 4, tzinfo=<iso8601.Utc>)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:0212
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days