Scalr\Service\Aws\Ec2\V20150415\Ec2Api::attachNetworkInterface PHP 메소드

attachNetworkInterface() 공개 메소드

Attaches a network interface to an instance.
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.
리턴 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;
    }
Ec2Api