November 23, 2017


SetPublicNetworkSpeed.php
SetPublicNetworkSpeed.php

<?php
/**
 * Set Public Network Interface Speed.
 * It sets the public network interface speed to the new speed.
 *
 * Important manual pages:
 * http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/setPublicNetworkInterfaceSpeed
 *
 * @license <http://sldn.softlayer.com/wiki/index.php/License>
 * @author SoftLayer Technologies, Inc. <sldn@softlayer.com>
 */

require_once(dirname(__FILE__) . '/SoftLayer/SoapClient.class.php');

/**
 * Set your SoftLayer API username and key.
 * */
$apiUsername = 'set me';
$apiKey = 'set me';
$serviceName ='SoftLayer_Virtual_Guest';


/**
 * Set the server id that you want to change the port speed value.
 * E.g. id = 1234.
 */
$serverId = 7991612;
/**
 * Set the new value for the port speed.
 * E.g. id = 10, 100.
 */

$newPortValue = 10;

/**
 * Create a client to the SoftLayer_Virtual_Guest API service.
 */
$client = SoftLayer_SoapClient::getClient($serviceName, $serverId , $apiUsername, $apiKey);

try {

    $receipt = $client->setPublicNetworkInterfaceSpeed($newPortValue);
    print_r($receipt);
} catch (Exception $e) {
    echo 'Unable to change the public port speed value: ' . $e->getMessage();
}

Feedback?

We would love to hear it
Open an issue