November 23, 2017
# Get the recurring cost of all servers on your account.
# Get a list of servers on a SoftLayer account along with their recurring
# monthly costs. We can get that by calling getHardware() in the
# SoftLayer_Account API service with an object mask to retrieve cost.
# Important manual pages
# see
# see
# License:
# Author: SoftLayer Technologies, Inc. <>
use lib 'C:/softlayerApis/perl/softlayer-api-perl-client-master/';
use SoftLayer::API::SOAP;
use JSON;
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);

# Declaring the object mask to get information about cost of the bare metal server
my $object_mask = 'mask(SoftLayer_Hardware_Server).cost';

my $servers = $account_service->getHardware();
# 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 bare metal servers." . $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