November 23, 2017


Get all Vulnerabilities Scan Requests from SoftLayer_Account.

This example shows how to get all scan request from SoftLayer_Account. On this case we'll filter
the response in order to get Pending or Processing requests (all uncompleted).
See below for more details.

Important manual pages:

Author: SoftLayer Technologies, Inc. <>

package main

import (

func main() {
	// SoftLayer API username and key
	username := "set me"
	apikey   := "set me"

	// Create a session
	sess := session.New(username, apikey)

	// Get SoftLayer_Account service
	service := services.GetAccountService(sess)

	You can filter using the following status:
		- Scan Pending
		- Scan Processing
		- Scan Complete
		- Scan Cancelled
		- Generating Report.
	Following filter is to get all uncompleted scan requests in the Account
	filter := filter.Path("").NotEq("Scan Complete").Build()

	// Object-Mask in order to get specific data
	mask := "createDate;id;ipAddress;guestId;hardwareId;status[name]"

	// Use getSecurityScanRequests() method to get all scan requests from Account.
	scanRequests, err := service.Filter(filter).Mask(mask).GetSecurityScanRequests()
	if err != nil {
		fmt.Printf("\n Unable to get the scan requests:\n - %s\n", err)

	// Following helps to print the result in json format.
	for _,scan := range scanRequests {
		jsonFormat, jsonErr := json.Marshal(scan)
		if jsonErr != nil {


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue