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
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.
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')
Out: <Entity u'https://10.8.197.248/api/container_images/150'>
#verified the entity has the scan action:
#Initiated the SmartState Analysis Scan
Out: <Entity u'https://10.8.197.248/api/container_images/150'
#Verified the scan was successfull
task = ocp.appliance.rest_api.collections.tasks.get(id='27')
u"Container Image Analysis: 'dotnet/dotnet-20-runtime-rhel7'"
#Verified the '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.