Created
September 30, 2013 16:05
-
-
Save underscorephil/6766068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SoftLayer.API | |
from pprint import pprint as pp | |
apiUsername = '' | |
apiKey = '' | |
client = SoftLayer.Client( | |
username=apiUsername, | |
api_key=apiKey, | |
) | |
# Retrieve all requests and their status | |
object_mask = 'mask.status' | |
result = client['Account'].getSecurityScanRequests(mask=object_mask) | |
pp(result) | |
# Retrieve a list of requests and pull their object/status individually | |
requests = client['Account'].getSecurityScanRequests(mask='mask.id') | |
for request in requests: | |
request_object = client['SoftLayer_Network_Security_Scanner_Request'].getObject(id=request['id'], mask=object_mask) | |
pp(request_object) | |
# Retrieve a list of requests and run getReport on each | |
requests = client['Account'].getSecurityScanRequests(mask='mask.id') | |
for request in requests: | |
report = client['SoftLayer_Network_Security_Scanner_Request'].getReport(id=request['id']) | |
pp(report) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment