November 23, 2017
# Set tags for a VSI
# The script sets the tags for an arbitrary VSI,
# it makes a single call to the SoftLayer_Virtual_Guest::setTags method
# For more information please see below.
# Important manual pages:
# License:
# Author: SoftLayer Technologies, Inc. <>
use lib 'softlayer-api-perl-client-master/';
use SoftLayer::API::SOAP;
use Data::Dumper;

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

# The virtual guest id you wish to set the tags
my $virtual_guest_id = 7844984;

# The tags you wish to set in the VSI
my $tags = "mytag1,mytag2,mytag3";

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


# Sending the request to set the tags
my $result = $virtual_guest_service->setTags($tags);

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