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. <>
require_once ('Softlayer/SoapClient.class.php');

// Your SoftLayer API username and key.
$apiUsername = 'set me';
$apiKey = 'set me';

$virtualGuestService = Softlayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $apiUsername, $apiKey);

// The id of the VSI to set the tags
$virtualGuestId = 7844984;

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

// Sending the request to set the tags
$result = $virtualGuestService->setTags($tags);



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