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
mixed $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
mixed $data $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
integer $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
Overrides
|
public
|
#
rebuild( array $params = array() )
Rebuilds an existing server
Rebuilds an existing server
Parameters
- $params
array $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
string $type A particular reboot State. See Constants\ServerState for string values.
Returns
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
string $name The name of the new image
- $metadata
array $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
mixed $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
|
|
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
string $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
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
string $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
string $network - if supplied, then only the IP(s) for the specified network are
returned. Otherwise, all IPs are returned.
Returns
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
OpenCloud\Volume\Resource\Volume
$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 /dev/xvhda , then the new volume would be attached to
/dev/xvhdb ).
- $device
string $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
|
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
|
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
string $path The path where the file will be stored on the target server (up to 255
characters)
- $data
string $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
Throws
Overrides
|
protected
|
#
updateJson( mixed $params = array() )
Provides JSON for update request body
Provides JSON for update request body
Overrides
|
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
type
|
$flavor
|
|
#
The Flavor for this server.
The Flavor for this server.
Link
|
public
type
|
$networks
|
array() |
|
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.
|
protected static
string
|
$json_name
|
'server' |
|
protected static
string
|
$url_resource
|
'servers' |
|
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
|