public attachNetworkInterface ( string $networkInterfaceId, string $instanceId, integer $deviceIndex ) : string | ||
$networkInterfaceId | string | The ID of the network interface |
$instanceId | string | The ID of the instance to attach to the network interface |
$deviceIndex | integer | The index of the device for the network interface attachment. |
return | string | Returns Attachment ID on success or throws an exception |
public function attachNetworkInterface($networkInterfaceId, $instanceId, $deviceIndex)
{
$result = null;
$options = array('NetworkInterfaceId' => (string) $networkInterfaceId, 'InstanceId' => (string) $instanceId, 'DeviceIndex' => (string) $deviceIndex);
$action = ucfirst(__FUNCTION__);
$response = $this->client->call($action, $options);
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
$result = (string) $sxml->attachmentId;
}
return $result;
}