November 23, 2017
# Get private image template
# The script calls the SoftLayer_Account::getPrivateBlockDeviceTemplateGroups method
# to list the private templates in the account and uses an object mask
# to display more related information of the images templates
# Important manual pages:
# License:
# Author: SoftLayer Technologies, Inc. <>
use lib 'C:/softlayerApis/perl/softlayer-api-perl-client-master/';
use SoftLayer::API::SOAP;
use Data::Dumper;

# Your SoftLayer API username and key.
my $username = 'set me';
my $key = 'set me';

# Creating a SoftLayer API client object
my $account_service = SoftLayer::API::SOAP->new('SoftLayer_Account', undef, $username, $key);

# Declaring an object mask to get more information about the images templates
my $object_mask = "mask[summary,note,status[name],storageRepository[datacenter],transaction[transactionGroup,transactionStatus],children[storageRepository[datacenter],blockDevices[diskImage[type]]]]";

# Setting the object Mask
# Setting the object mask in the service and call the getPrivateBlockDeviceTemplateGroups to list the image templates
my $result = $account_service->getPrivateBlockDeviceTemplateGroups();
if ($result->fault) {
    die 'Unable to get the image templates. ' . $result->faultstring;
print Dumper($result->result);


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