November 23, 2017


Retrieve the list of available SoftLayer_Network_Storage volumes that can be authorized
to a SoftLayer_Network_Subnet object. To do this we'll use the method getAvailableNetworkStorages().
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"

	// The id of Subnet you wish to get information about available network storages.
	subnetId := 22545

	// Declare what NAS type of storages you wish to get, it can be either 'ISCSI',
	// 'NAS', or '*' for both
	nasType := "*"

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

	// Get SoftLayer_Network_Subnet service
	service := services.GetNetworkSubnetService(sess)

	// Call the method getAvailableNetworkStorages()
	availableStorages, err := service.Id(subnetId).GetAvailableNetworkStorages(&nasType)
	if err != nil {
		fmt.Printf("\n Unable to get available network storages:\n - %s\n", err)

	// Following helps to print the result in json format.
	for _, storage := range availableStorages {
		jsonFormat, jsonErr := json.Marshal(storage)
		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