Methods summary
public
|
#
__construct( OpenCloud\Compute\Service $service, mixed $info = null )
Creates a new Server object and associates it with a Compute service
Creates a new Server object and associates it with a Compute service
Parameters
- $service
- $info * If NULL, an empty Server object is created * If an object, then a Server
object is created from the data in the object * If a string, then it's treated
as a Server ID and retrieved from the service The normal use case for SDK
clients is to treat it as either NULL or an ID. The object value parameter is a
special case used to construct a Server object from a ServerList element to
avoid a secondary call to the Service.
- $info
- $data
Throws
ServerNotFound if a 404 is returned
UnknownError if another error status is reported
Overrides
|
public
string
|
#
ip( integer $type = null )
Returns the primary external IP address of the server
Returns the primary external IP address of the server
This function is based upon the accessIPv4 and accessIPv6 values. By default,
these are set to the public IP address of the server. However, these values can
be modified by the user; this might happen, for example, if the server is behind
a firewall and needs to be routed through a NAT device to be reached.
Parameters
- $type
- the type of IP version (4 or 6) to return
Returns
string IP address
Api
|
public
Guzzle\Http\Message\Response
|
#
create( array $params = array() )
Create a new resource
Parameters
Returns
Guzzle\Http\Message\Response \Guzzle\Http\Message\Response
Overrides
|
public
|
#
rebuild( array $params = array() )
Rebuilds an existing server
Rebuilds an existing server
Parameters
- $params
- - an associative array of key/value pairs of attributes to set on the new server
Api
|
public
Guzzle\Http\Message\Response
|
#
reboot( string $type = null )
Reboots a server
A "soft" reboot requests that the operating system reboot itself; a "hard"
reboot is the equivalent of pulling the power plug and then turning it back on,
with a possibility of data loss.
Parameters
- $type
- A particular reboot State. See Constants\ServerState for string values.
Returns
Guzzle\Http\Message\Response \Guzzle\Http\Message\Response
Api
|
public
boolean|OpenCloud\Compute\Resource\Image
|
#
createImage( string $name, array $metadata = array() )
Creates a new image from a server
Creates a new image from a server
Parameters
- $name
- The name of the new image
- $metadata
- Optional metadata to be stored on the image
Returns
Throws
Api
|
public
mixed
|
#
imageSchedule( mixed $retention = false )
Schedule daily image backups
Schedule daily image backups
Parameters
- $retention
- - false (default) indicates you want to retrieve the image schedule. $retention
<= 0 indicates you want to delete the current schedule. $retention > 0
indicates you want to schedule image backups and you would like to retain
$retention backups.
Returns
mixed an object or FALSE on error
Throws
Api
|
public
boolean
|
#
resize( OpenCloud\Compute\Resource\Flavor $flavorRef )
Initiates the resize of a server
Initiates the resize of a server
Parameters
- $flavorRef
- a Flavor object indicating the new server size
Returns
boolean TRUE on success; FALSE on failure
Api
|
public
boolean
|
#
resizeConfirm( )
confirms the resize of a server
confirms the resize of a server
Returns
boolean TRUE on success; FALSE on failure
Api
|
public
boolean
|
#
resizeRevert( )
reverts the resize of a server
reverts the resize of a server
Returns
boolean TRUE on success; FALSE on failure
Api
|
public
boolean
|
#
setPassword( string $newPassword )
Sets the root password on the server
Sets the root password on the server
Parameters
- $newPassword
- The new root password for the server
Returns
boolean TRUE on success; FALSE on failure
Api
|
public
string
|
#
rescue( )
Puts the server into rescue mode
Puts the server into rescue mode
Returns
string the root password of the rescue server
Throws
Link
Api
|
public
HttpResponse
|
#
unrescue( )
Takes the server out of RESCUE mode
Takes the server out of RESCUE mode
Returns
HttpResponse HttpResponse
Throws
Link
Api
|
public
OpenCloud\Compute\Resource\ServerMetadata
|
#
metadata( string $key = null )
Retrieves the metadata associated with a Server.
Retrieves the metadata associated with a Server.
If a metadata item name is supplied, then only the single item is returned.
Otherwise, the default is to return all metadata associated with a server.
Parameters
- $key
- - the (optional) name of the metadata item to return
Returns
Throws
Api
|
public
object
|
#
ips( string $network = null )
Returns the IP address block for the Server or for a specific network.
Returns the IP address block for the Server or for a specific network.
Parameters
- $network
- - if supplied, then only the IP(s) for the specified network are returned.
Otherwise, all IPs are returned.
Returns
object object
Throws
Api
|
public
|
#
attachVolume( OpenCloud\Volume\Resource\Volume $volume, string $device = 'auto' )
Attaches a volume to a server
Attaches a volume to a server
Requires the os-volumes extension. This is a synonym for
VolumeAttachment::create()
Parameters
- $volume
- The volume to attach. If "auto" is specified (the default), then the first
available device is used to mount the volume (for example, if the primary disk
is on <code>/dev/xvhda</code>, then the new volume would be attached to
<code>/dev/xvhdb</code>).
- $device
- the device to which to attach it
Api
|
public
|
#
detachVolume( OpenCloud\Volume\Resource\Volume $volume )
Removes a volume attachment from a server
Removes a volume attachment from a server
Requires the os-volumes extension. This is a synonym for
VolumeAttachment::delete()
Parameters
- $volume
- The volume to remove
|
public
|
#
volumeAttachment( mixed $id = null )
Returns a VolumeAttachment object
Returns a VolumeAttachment object
|
public
Collection
|
#
volumeAttachmentList( )
Returns a Collection of VolumeAttachment objects
Returns a Collection of VolumeAttachment objects
Returns
Collection Collection
|
public
|
#
addFile( string $path, string $data )
Adds a "personality" file to be uploaded during create() or rebuild()
Adds a "personality" file to be uploaded during create() or rebuild()
Parameters
- $path
- The path where the file will be stored on the target server (up to 255
characters)
- $data
- the file contents (max size set by provider)
Api
|
public
|
#
console( mixed $type = 'novnc' )
Returns a console connection Note: Where is this documented?
Returns a console connection Note: Where is this documented?
CodeCoverageIgnore
|
protected
object
|
#
createJson( )
Provides JSON for create request body
Provides JSON for create request body
Returns
object object
Throws
Overrides
|
protected
|
#
updateJson( mixed $params = array() )
Provides JSON for update request body
Provides JSON for update request body
Overrides
|
public
Guzzle\Http\Message\Response
|
#
suspend( )
Suspend a server
A suspend request suspend an instance, its VM state is stored on disk, all
memory is written to disk, and the virtual machine is stopped. Suspending an
instance is similar to placing a device in hibernation; memory and vCPUs become
available to create other instances.
Returns
Guzzle\Http\Message\Response \Guzzle\Http\Message\Response
Api
|
public
Guzzle\Http\Message\Response
|
#
resume( )
Resume a server
A resume request resumes a suspended instance, its VM state was stored on
disk, all memory was written to disk, and the virtual machine was stopped.
Resuming a suspended instance is similar to resuming a device from
hibernation.
Returns
Guzzle\Http\Message\Response \Guzzle\Http\Message\Response
Api
|
public
object
|
#
diagnostics( )
Get server diagnostics
Gets basic usage data for a specified server.
Returns
object object
Api
|
public
Guzzle\Http\Message\Response
|
#
start( )
Start a server
Starts a stopped server and changes its status to ACTIVE.
Returns
Guzzle\Http\Message\Response \Guzzle\Http\Message\Response
Api
|
public
Guzzle\Http\Message\Response
|
#
stop( )
Stop a server
Stops a running server and changes its status to STOPPED.
Returns
Guzzle\Http\Message\Response \Guzzle\Http\Message\Response
Api
|
Properties summary
public
string
|
$status
|
|
public
string
|
$updated
The time stamp for the last update.
The time stamp for the last update.
|
|
public
string
|
$hostId
The compute provisioning algorithm has an anti-affinity property that
attempts to spread customer VMs across hosts. Under certain situations, VMs from
the same customer might be placed on the same host. $hostId represents the host
your server runs on and can be used to determine this scenario if it is relevant
to your application.
The compute provisioning algorithm has an anti-affinity property that
attempts to spread customer VMs across hosts. Under certain situations, VMs from
the same customer might be placed on the same host. $hostId represents the host
your server runs on and can be used to determine this scenario if it is relevant
to your application.
|
|
public
type
|
$addresses
Public and private IP addresses for this server.
Public and private IP addresses for this server.
|
|
public
array
|
$links
|
|
public
OpenCloud\Image\Resource\ImageInterface
|
$image
The Image for this server.
The Image for this server.
Link
|
|
public
OpenCloud\Volume\Resource\Volume
|
$volume
The bootable volume for this server.
The bootable volume for this server.
|
|
public
boolean
|
$volumeDeleteOnTermination
Whether to delete the bootable volume when the server is terminated
(deleted).
Whether to delete the bootable volume when the server is terminated
(deleted).
|
|
public
type
|
$flavor
The Flavor for this server.
The Flavor for this server.
Link
|
|
public
type
|
$networks
|
|
public
string
|
$id
|
|
public
string
|
$user_id
|
|
public
string
|
$name
|
|
public
string
|
$created
The time stamp for the creation date.
The time stamp for the creation date.
|
|
public
string
|
$tenant_id
|
|
public
string
|
$accessIPv4
The public IP version 4 access address.
The public IP version 4 access address.
|
|
public
string
|
$accessIPv6
The public IP version 6 access address.
The public IP version 6 access address.
|
|
public
integer
|
$progress
The build completion progress, as a percentage. Value is from 0 to 100.
The build completion progress, as a percentage. Value is from 0 to 100.
|
|
public
string
|
$adminPass
The root password (only populated on server creation).
The root password (only populated on server creation).
|
|
public
mixed
|
$metadata
Metadata key and value pairs.
Metadata key and value pairs.
|
|
public
string
|
$extendedStatus
Virtual machine status.
Link
|
|
public
string
|
$taskStatus
Status indicating a running task
Status indicating a running task
Link
|
|
public
integer
|
$powerStatus
Power status of the VM
Link
|
|
public
string
|
$availabilityZone
Availability zone of the VM
Availability zone of the VM
Link
|
|
protected static
string
|
$json_name
|
|
protected static
string
|
$url_resource
|
|
public
string|object
|
$keypair
Keypair or string representation of keypair name
Keypair or string representation of keypair name
|
|
public
string
|
$user_data
Cloud-init boot executable code
Cloud-init boot executable code
|
|
protected
array
|
$aliases
The aliases configure for the properties of the instance.
The aliases configure for the properties of the instance.
|
#array(
'OS-EXT-STS:vm_state' => 'extendedStatus',
'OS-EXT-STS:task_state' => 'taskStatus',
'OS-EXT-STS:power_state' => 'powerStatus',
'OS-EXT-AZ:availability_zone' => 'availabilityZone'
) |