November 23, 2017
# Retrieve VLAN details such as primary router and subnet.
# Retrieving the primary router and subnet for a determinate VLAN
# associated with a SoftLayer customer account 
# We do this with a call to the getObject() method in the 
# SoftLayer_Network_Vlan API service using an object mask to retrieve  
# associated subnets and primary router records. See below for more details.
# Important manual pages:
# License:
# Author: SoftLayer Technologies, Inc. <>
use lib 'softlayer-api-perl-client-master/';
use SoftLayer::API::SOAP;
use JSON;
use Data::Dumper;

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

# The VLAN id you wish to see its details
my $vlan_id = 557984;

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


# Declaring an object mask to get more information about the VLANs
# such as the primaryRouter and the subnets
my $object_mask = "mask[primaryRouter, subnets[ipAddresses]]";

# Send the request to get the VLANs
my $result = $network_vlan_service->getObject();

if ($result->fault) {
    die 'Unable to retrieve the VLAN details ' . $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