modify_network_interface_attribute ( $network_interface_id, $opt )

Access

public

Parameters

Parameter

Type

Required

Description

$network_interface_id

string

Required

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • Description.Value - string - Optional - String value
  • SourceDestCheck.Value - boolean - Optional - Boolean value
  • SecurityGroupId - string|array - Optional - Pass a string for a single value, or an indexed array for multiple values.
  • Attachment - array - Optional -
    • x - array - Optional - This represents a simple array index.
      • AttachmentId - string - Optional -
      • DeleteOnTermination - boolean - Optional -
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Modify, describe, and reset network interface attributes.

$ec2 = new AmazonEC2();

###########################################################################
# Modify Network Interface Attribute

$response = $ec2->modify_network_interface_attribute($network_interface_id, array(
	'SourceDestCheck.Value' => 'false',
));

var_dump($response->isOK());

###########################################################################
# Describe Network Interface Attributes

$response = $ec2->describe_network_interface_attribute($network_interface_id, array(
        'Attribute' => 'sourceDestCheck',
));

var_dump($response->isOK());

###########################################################################
# Reset Network Interface Attribute

$response = $ec2->reset_network_interface_attribute($network_interface_id, array(
	'Attribute' => 'sourceDestCheck',
));

var_dump($response->isOK());

sleep(5);
Result:
bool(true)
bool(true)
bool(true)

Source

Method defined in services/ec2.class.php | Toggle source view (25 lines) | View on GitHub

public function modify_network_interface_attribute($network_interface_id, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['NetworkInterfaceId'] = $network_interface_id;
    
    // Optional list (non-map)
    if (isset($opt['SecurityGroupId']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'SecurityGroupId' => (is_array($opt['SecurityGroupId']) ? $opt['SecurityGroupId'] : array($opt['SecurityGroupId']))
        )));
        unset($opt['SecurityGroupId']);
    }
    
    // Optional map (non-list)
    if (isset($opt['Attachment']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'Attachment' => $opt['Attachment']
        )));
        unset($opt['Attachment']);
    }

    return $this->authenticate('ModifyNetworkInterfaceAttribute', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback