November 23, 2017
# Retrieve the user data for the VSIs in the account
# The script gets the user metadata for a VSI in the account. We make a simple
# call the getVirtualGuests() in the SoftLayer_Virtual_Guest API service
# and we set an object mask to get the information about the user data
# 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;
use strict;
# Your SoftLayer API username and key
my $api_username = 'set me';
my $api_key = 'set me';

# Declaring the service
my $account_service = SoftLayer::API::SOAP->new('SoftLayer_Account', undef, $api_username, $api_key);

# Adding the object mask to the call to get the information about the user data.
my $object_mask = 'mask[userData]';

# Retrieving our account's VSIs records.
my $servers = $account_service->getVirtualGuests();
# If there was an error returned from the SoftLayer API then die out with the
# error message.
if ($servers->fault) {
    die "Unable to retrieve the VSI list. " . $servers->faultstring;

print Dumper($servers->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