Bug 1486362 - [RFE] Add API call for container scanning via SmartState [NEEDINFO]
Summary: [RFE] Add API call for container scanning via SmartState
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: MVP
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: juwatts
URL:
Whiteboard: container
Depends On:
Blocks: 1511957 1552279 1555371 1597407
TreeView+ depends on / blocked
 
Reported: 2017-08-29 14:57 UTC by Robb Manes
Modified: 2019-02-07 23:02 UTC (History)
10 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1552279 (view as bug list)
Environment:
Last Closed: 2019-02-07 23:02:39 UTC
Category: ---
Cloudforms Team: Container Management
Target Upstream Version:
lavenel: needinfo? (epacific)


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:0212 None None None 2019-02-07 23:02:48 UTC

Description Robb Manes 2017-08-29 14:57:07 UTC
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.

Comment 10 juwatts 2018-09-24 17:59:43 UTC
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>)

Comment 12 errata-xmlrpc 2019-02-07 23:02:39 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


Note You need to log in before you can comment on or make changes to this bug.