import_instance ( $platform, $opt )

Access

public

Parameters

Parameter

Type

Required

Description

$platform

string

Required

$opt

array

Optional

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

  • Description - string - Optional -
  • LaunchSpecification - array - Optional -
    • x - array - Optional - This represents a simple array index.
      • Architecture - string - Optional -
      • SecurityGroup - string|array - Optional - Pass a string for a single value, or an indexed array for multiple values.
      • AdditionalInfo - string - Optional -
      • UserData - string - Optional -
      • InstanceType - string - Optional - [Allowed values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, m3.xlarge, m3.2xlarge, c1.medium, c1.xlarge, hi1.4xlarge, hs1.8xlarge, cc1.4xlarge, cc2.8xlarge, cg1.4xlarge]
      • Placement - array - Optional - Describes where an Amazon EC2 instance is running within an Amazon EC2 region.
        • x - array - Optional - This represents a simple array index.
          • AvailabilityZone - string - Optional - The availability zone in which an Amazon EC2 instance runs.
          • GroupName - string - Optional - The name of the PlacementGroup in which an Amazon EC2 instance runs. Placement groups are primarily used for launching High Performance Computing instances in the same group to ensure fast connection speeds.
          • Tenancy - string - Optional - The allowed tenancy of instances launched into the VPC. A value of default means instances can be launched with any tenancy; a value of dedicated means all instances launched into the VPC will be launched as dedicated tenancy regardless of the tenancy assigned to the instance at launch.
      • BlockDeviceMapping - array - Optional - The BlockDeviceMappingItemType data type.
        • x - array - Optional - This represents a simple array index.
          • VirtualName - string - Optional - Specifies the virtual device name.
          • DeviceName - string - Optional - Specifies the device name (e.g., /dev/sdh).
          • Ebs - array - Optional - Specifies parameters used to automatically setup Amazon EBS volumes when the instance is launched.
            • x - array - Optional - This represents a simple array index.
              • SnapshotId - string - Optional - The ID of the snapshot from which the volume will be created.
              • VolumeSize - integer - Optional - The size of the volume, in gigabytes.
              • DeleteOnTermination - boolean - Optional - Specifies whether the Amazon EBS volume is deleted on instance termination.
              • VolumeType - string - Optional - [Allowed values: standard, io1]
              • Iops - integer - Optional -
          • NoDevice - string - Optional - Specifies the device name to suppress during instance launch.
      • Monitoring - boolean - Optional -
      • SubnetId - string - Optional -
      • DisableApiTermination - boolean - Optional -
      • InstanceInitiatedShutdownBehavior - string - Optional -
      • PrivateIpAddress - string - Optional -
  • DiskImage - array - Optional -
    • x - array - Optional - This represents a simple array index.
      • Image - array - Optional -
        • x - array - Optional - This represents a simple array index.
          • Format - string - Required -
          • Bytes - long - Required -
          • ImportManifestUrl - string - Required -
      • Description - string - Optional -
      • Volume - array - Optional -
        • x - array - Optional - This represents a simple array index.
          • Size - long - Required -
  • 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.

Source

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

public function import_instance($platform, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['Platform'] = $platform;
    
    // Optional map (non-list)
    if (isset($opt['LaunchSpecification']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'LaunchSpecification' => $opt['LaunchSpecification']
        )));
        unset($opt['LaunchSpecification']);
    }
    
    // Optional list + map
    if (isset($opt['DiskImage']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'DiskImage' => $opt['DiskImage']
        )));
        unset($opt['DiskImage']);
    }

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback