Scalr\Service\Aws\Ec2\V20150415\Ec2Api::resetNetworkInterfaceAttribute PHP Method

resetNetworkInterfaceAttribute() public method

Resets a network interface attribute.You can specify only one attribute at a time
public resetNetworkInterfaceAttribute ( string $networkInterfaceId, Scalr\Service\Aws\Ec2\DataType\NetworkInterfaceAttributeType $attr ) : boolean
$networkInterfaceId string The ID of the network interface.
$attr Scalr\Service\Aws\Ec2\DataType\NetworkInterfaceAttributeType The attribute name.
return boolean Returns TRUE on success
    public function resetNetworkInterfaceAttribute($networkInterfaceId, NetworkInterfaceAttributeType $attr)
    {
        $result = false;
        $options = array('NetworkInterfaceId' => (string) $networkInterfaceId, 'Attribute' => (string) $attr);
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not %s NetworkInterfaceId:"%s" Attribute:"%s". It returned "%s"', $action, $options['NetworkInterfaceId'], $attr, $sxml->return));
            }
            $result = true;
        }
        return $result;
    }
Ec2Api