PHP Class Scalr\Service\Aws\Ec2\DataType\InstanceData

Describes a running instance.
Since: 09.01.2013
Author: Vitaliy Demidov ([email protected])
Inheritance: extends Scalr\Service\Aws\Ec2\AbstractEc2DataType
Show file Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$amiLaunchIndex string The AMI launch index, which can be used to find this instance within the launch group.
$architecture string i386 | x86_64
$clientToken string The idempotency token you provided when you launched the instance.
$dnsName string The public DNS name assigned to the instance. This DNS name is contactable from outside the Amazon EC2 network. This element remains empty until the instance enters a running state.
$ebsOptimized boolean This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn’t available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
$hypervisor string ovm | xen
$imageId string The ID of the AMI used to launch the instance.
$instanceId string The ID of the instance launched.
$instanceLifecycle string spot | blank (no value)
$instanceType string The instance type (for example, m1.small).
$ipAddress string The IP address of the instance
$kernelId string The kernel associated with this instance.
$keyName string The key pair name, if this instance was launched with an associated key pair.
$launchTime DateTime The time the instance was launched.
$platform string The platform of the instance (e.g., Windows).
$privateDnsName string The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This element remains empty until the instance enters a running state.
$privateIpAddress string The private IP address assigned to the instance.
$ramdiskId string The RAM disk associated with this instance.
$reason string This might be an empty string.
$rootDeviceName string The root device name (e.g., /dev/sda1).
$rootDeviceType string ebs | instance-store
$sourceDestCheck boolean Specifes whether to enable a Network Address Translation (NAT) instance in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the instance to perform NAT
$spotInstanceRequestId string The ID of the Spot Instance request
$sriovNetSupport string Specifies whether enhanced networking is enabled.
$subnetId string The subnet ID in which the instance is running.
$virtualizationType string The instance's virtualization type
$vpcId string The VPC in which the instance is running.

Protected Properties

Property Type Description
$_externalKeys array List of external identifier names.
$_properties array List of the public properties which is managed by magic getter and setters internally.

Public Methods

Method Description
attachNetworkInterface ( string $networkInterfaceId, integer $deviceIndex ) : string AttachNetworkInterface action
attachVolume ( string $volumeId, string $device ) : AttachmentSetResponseData AttachVolume action
createTags ( Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList | Scalr\Service\Aws\Ec2\DataType\ResourceTagSetData | array $tagList ) : boolean CreateTags action
deleteTags ( Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList | Scalr\Service\Aws\Ec2\DataType\ResourceTagSetData | array $tagList ) : boolean DeleteTags action
describeAttribute ( Scalr\Service\Aws\Ec2\DataType\InstanceAttributeType | string $attribute ) : mixed DescribeInstanceAttribute action
describeStatus ( ) : Scalr\Service\Aws\Ec2\DataType\InstanceStatusData | null DescribeInstanceStatus action
detachVolume ( string $volumeId, string $device = null, boolean $force = null ) : AttachmentSetResponseData DetachVolume action
getConsoleOutput ( ) : GetConsoleOutputResponseData GetConsoleOutput action
getPasswordData ( ) : GetPasswordDataResponseData GetPasswordData action
modifyAttribute ( Scalr\Service\Aws\Ec2\DataType\InstanceAttributeType | string $attribute, mixed $value ) : boolean ModifyInstanceAttribute action
monitor ( ) : Scalr\Service\Aws\Ec2\DataType\MonitorInstancesResponseSetList MonitorInstances action
reboot ( ) : boolean RebootInstances action
refresh ( ) : InstanceData DescribeInstances action
start ( ) : Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList StartInstances action
stop ( boolean $force = null ) : Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList StopInstances action
terminate ( ) : Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList TerminateInstances
unmonitor ( ) : Scalr\Service\Aws\Ec2\DataType\MonitorInstancesResponseSetList UnmonitorInstances action

Protected Methods

Method Description
throwExceptionIfNotInitialized ( )

Method Details

attachNetworkInterface() public method

Attaches a network interface to an instance.
public attachNetworkInterface ( string $networkInterfaceId, integer $deviceIndex ) : string
$networkInterfaceId string The ID of 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

attachVolume() public method

Attaches an Amazon EBS volume to a running instance and exposes it to the instance with the specified device name. For a list of supported device names, see Attaching the Volume to an Instance. Any device names that aren't reserved for instance store volumes can be used for Amazon EBS volumes. Note! If a volume has an AWS Marketplace product code: -The volume can only be attached to the root device of a stopped instance. -You must be subscribed to the AWS Marketplace code that is on the volume. -The configuration (instance type, operating system) of the instance must support that specific AWS Marketplace code. For example, you cannot take a volume from a Windows instance and attach it to a Linux instance. -AWS Marketplace product codes are copied from the volume to the instance.
public attachVolume ( string $volumeId, string $device ) : AttachmentSetResponseData
$volumeId string The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone
$device string The device name as exposed to the instance
return AttachmentSetResponseData Returns AttachmentSetResponseData on success

createTags() public method

Adds or overwrites one or more tags for the specified EC2 resource or resources. Each resource can have a maximum of 10 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
public createTags ( Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList | Scalr\Service\Aws\Ec2\DataType\ResourceTagSetData | array $tagList ) : boolean
$tagList Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList | Scalr\Service\Aws\Ec2\DataType\ResourceTagSetData | array The key/value pair list of the Tags.
return boolean Returns true on success or throws an exception otherwise

deleteTags() public method

Deletes a specific set of tags from a specific set of resources. This call is designed to follow a DescribeTags call. You first determine what tags a resource has, and then you call DeleteTags with the resource ID and the specific tags you want to delete.
public deleteTags ( Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList | Scalr\Service\Aws\Ec2\DataType\ResourceTagSetData | array $tagList ) : boolean
$tagList Scalr\Service\Aws\Ec2\DataType\ResourceTagSetList | Scalr\Service\Aws\Ec2\DataType\ResourceTagSetData | array The key/value pair list of the Tags.
return boolean Returns true on success or throws an exception otherwise

describeAttribute() public method

Describes an attribute of the specified instance
public describeAttribute ( Scalr\Service\Aws\Ec2\DataType\InstanceAttributeType | string $attribute ) : mixed
$attribute Scalr\Service\Aws\Ec2\DataType\InstanceAttributeType | string The attribute.
return mixed Returns attribute value. It may be scalar value or object depends on attribute.

describeStatus() public method

DescribeInstanceStatus action
public describeStatus ( ) : Scalr\Service\Aws\Ec2\DataType\InstanceStatusData | null
return Scalr\Service\Aws\Ec2\DataType\InstanceStatusData | null Returns InstanceStatusData object or NULL

detachVolume() public method

Detaches an Amazon EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so will result in volume being stuck in "busy" state while detaching. Note! If an Amazon EBS volume is the root device of an instance, it cannot be detached while the instance is in the "running" state. To detach the root volume, stop the instance first. If the root volume is detached from an instance with an AWS Marketplace product code, then the AWS Marketplace product codes from that volume are no longer associated with the instance.
public detachVolume ( string $volumeId, string $device = null, boolean $force = null ) : AttachmentSetResponseData
$volumeId string The ID of the EBS volume.
$device string optional The device name.
$force boolean optional Forces detachment if the previous detachment attempt did not occur cleanly (logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance won't have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures.
return AttachmentSetResponseData Returns AttachmentSetResponseData on success

getConsoleOutput() public method

Retrieves console output for the specified instance. Instance console output is buffered and posted shortly after instance boot, reboot, and termination. Amazon EC2 preserves the most recent 64 KB output which will be available for at least one hour after the most recent post.
public getConsoleOutput ( ) : GetConsoleOutputResponseData
return GetConsoleOutputResponseData Returns object which represents console output.

getPasswordData() public method

Retrieves the encrypted administrator password for an instance running Windows. Note! The Windows password is only generated the first time an AMI is launched. It is not generated for rebundled AMIs or after the password is changed on an instance. The password is encrypted using the key pair that you provided.
public getPasswordData ( ) : GetPasswordDataResponseData
return GetPasswordDataResponseData Returns object which represents console output.

modifyAttribute() public method

Modifies the specified attribute of the specified instance. You can specify only one attribute at a time. To modify some attributes, the instance must be stopped.
public modifyAttribute ( Scalr\Service\Aws\Ec2\DataType\InstanceAttributeType | string $attribute, mixed $value ) : boolean
$attribute Scalr\Service\Aws\Ec2\DataType\InstanceAttributeType | string The attribute name.
$value mixed The attribute value can be string, boolean, array or object depends on attribute name.
return boolean Returns TRUE on success

monitor() public method

Enables monitoring for a running instance.
public monitor ( ) : Scalr\Service\Aws\Ec2\DataType\MonitorInstancesResponseSetList
return Scalr\Service\Aws\Ec2\DataType\MonitorInstancesResponseSetList Returns the MonitorInstancesResponseSetList

reboot() public method

Requests a reboot of one or more instances. This operation is asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed if the instances are valid and belong to you. Requests to reboot terminated instances are ignored. Note! If a Linux/UNIX instance does not cleanly shut down within four minutes, Amazon EC2 will perform a hard reboot.
public reboot ( ) : boolean
return boolean Returns true on success or throws an exception otherwise

refresh() public method

This action will refresh current InstanceData object with retrieved information from AWS. Describes one or more of your instances. If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an invalid instance ID, an error is returned. If you specify an instance that you do not own, it is not included in the returned results. Recently terminated instances might appear in the returned results. This interval is usually less than one hour. NOTE! It refreshes object itself only when EntityManager is enabled. Decision is to use $object = object->refresh() instead;
public refresh ( ) : InstanceData
return InstanceData

start() public method

Starts an Amazon EBS-backed AMI that you've previously stopped. Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time. Each time you transition an instance from stopped to started, we charge a full instance hour, even if transitions happen multiple times within a single hour. Note! Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM. Performing this operation on an instance that uses an instance store as its root device returns an error.
public start ( ) : Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList
return Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList Return the InstanceStateChangeList

stop() public method

Stops an Amazon EBS-backed instance. Each time you transition an instance from stopped to started, we charge a full instance hour, even if transitions happen multiple times within a single hour. Important! Although Spot Instances can use Amazon EBS-backed AMIs, they don't support Stop/Start. In other words, you can't stop and start Spot Instances launched from an AMI with an Amazon EBS root device. Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started.When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage.You can restart your instance at any time. Note! Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM. Performing this operation on an instance that uses an instance store as its root device returns an error. You can stop, start, and terminate EBS-backed instances.You can only terminate S3-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted
public stop ( boolean $force = null ) : Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList
$force boolean optional Forces the instance to stop. The instance will not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
return Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList Return the InstanceStateChangeList

terminate() public method

Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call will succeed. Terminated instances will remain visible after termination (approximately one hour). Note! By default, Amazon EC2 deletes all Amazon EBS volumes that were attached when the instance launched. Amazon EBS volumes attached after instance launch continue running. You can stop, start, and terminate EBS-backed instances.You can only terminate S3-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted.
public terminate ( ) : Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList
return Scalr\Service\Aws\Ec2\DataType\InstanceStateChangeList Returns the InstanceStateChangeList

throwExceptionIfNotInitialized() protected method

unmonitor() public method

Disables monitoring for a running instance.
public unmonitor ( ) : Scalr\Service\Aws\Ec2\DataType\MonitorInstancesResponseSetList
return Scalr\Service\Aws\Ec2\DataType\MonitorInstancesResponseSetList Returns the MonitorInstancesResponseSetList

Property Details

$_externalKeys protected property

List of external identifier names.
protected array $_externalKeys
return array

$_properties protected property

List of the public properties which is managed by magic getter and setters internally.
protected array $_properties
return array

$amiLaunchIndex public property

The AMI launch index, which can be used to find this instance within the launch group.
public string $amiLaunchIndex
return string

$architecture public property

i386 | x86_64
public string $architecture
return string

$clientToken public property

The idempotency token you provided when you launched the instance.
public string $clientToken
return string

$dnsName public property

The public DNS name assigned to the instance. This DNS name is contactable from outside the Amazon EC2 network. This element remains empty until the instance enters a running state.
public string $dnsName
return string

$ebsOptimized public property

This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn’t available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
public bool $ebsOptimized
return boolean

$hypervisor public property

ovm | xen
public string $hypervisor
return string

$imageId public property

The ID of the AMI used to launch the instance.
public string $imageId
return string

$instanceId public property

The ID of the instance launched.
public string $instanceId
return string

$instanceLifecycle public property

spot | blank (no value)
public string $instanceLifecycle
return string

$instanceType public property

The instance type (for example, m1.small).
public string $instanceType
return string

$ipAddress public property

The IP address of the instance
public string $ipAddress
return string

$kernelId public property

The kernel associated with this instance.
public string $kernelId
return string

$keyName public property

The key pair name, if this instance was launched with an associated key pair.
public string $keyName
return string

$launchTime public property

The time the instance was launched.
public DateTime $launchTime
return DateTime

$platform public property

The platform of the instance (e.g., Windows).
public string $platform
return string

$privateDnsName public property

The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This element remains empty until the instance enters a running state.
public string $privateDnsName
return string

$privateIpAddress public property

The private IP address assigned to the instance.
public string $privateIpAddress
return string

$ramdiskId public property

The RAM disk associated with this instance.
public string $ramdiskId
return string

$reason public property

This might be an empty string.
public string $reason
return string

$rootDeviceName public property

The root device name (e.g., /dev/sda1).
public string $rootDeviceName
return string

$rootDeviceType public property

ebs | instance-store
public string $rootDeviceType
return string

$sourceDestCheck public property

Specifes whether to enable a Network Address Translation (NAT) instance in a VPC to perform NAT. This controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the instance to perform NAT
public bool $sourceDestCheck
return boolean

$spotInstanceRequestId public property

The ID of the Spot Instance request
public string $spotInstanceRequestId
return string

$sriovNetSupport public property

Specifies whether enhanced networking is enabled.
public string $sriovNetSupport
return string

$subnetId public property

The subnet ID in which the instance is running.
public string $subnetId
return string

$virtualizationType public property

The instance's virtualization type
public string $virtualizationType
return string

$vpcId public property

The VPC in which the instance is running.
public string $vpcId
return string