The Base class is the root class for all other objects used or defined by
this SDK. It contains common code for error handling as well as service functions that
are useful. Because it is an abstract class, it cannot be called directly,
and it has no publicly-visible properties.
Checks the attribute $property and only permits it if the prefix is
in the specified $prefixes array This is to support extension namespaces in some services.
Arguments
Name
Type
Description
Default
$property
string
the name of the attribute
$prefixes
array
a list of prefixes
array()
Return value
Type
Description
boolean
TRUE if valid; FALSE if not
CheckJsonError(
)
:
boolean
Description
Checks the most recent JSON operation for errors This function should be called after any `json_*()` function call.
This ensures that nasty JSON errors are detected and the proper
exception thrown.
Example:
`$obj = json_decode($string);`
`if (check_json_error()) do something ...`
Sets an extended (unrecognized) property on the current object If RAXSDK_STRICT_PROPERTY_CHECKS is TRUE, then the prefix of the
property name must appear in the $prefixes array, or else an
exception is thrown.
Arguments
Name
Type
Description
Default
$property
string
the property name
$value
mixed
the value of the property
$prefixes
array
optional list of supported prefixes
array()
Return value
Type
Description
n/a
n/a
Tags
Name
Description
throws
if strict checks are on and
the property prefix is not in the list of prefixes.
Url(
$subresource
= '',
)
:
n/a
Description
Returns the URL of the service/object The assumption is that nearly all objects will have a URL; at this
base level, it simply throws an exception to enforce the idea that
subclasses need to define this method.
Arguments
Name
Type
Description
Default
$subresource
n/a
''
Return value
Type
Description
n/a
n/a
Tags
Name
Description
throws
__set(
string
$property,
mixed
$value,
)
:
void
Description
Sets extended attributes on an object and validates them This function is provided to ensure that attributes cannot
arbitrarily added to an object. If this function is called, it
means that the attribute is not defined on the object, and thus
an exception is thrown.
Arguments
Name
Type
Description
Default
$property
string
the name of the attribute
$value
mixed
the value of the attribute
Return value
Type
Description
void
debug(
)
:
void
Description
Displays a debug message if $RAXSDK_DEBUG is TRUE The primary parameter is a string in sprintf() format, and it can accept
up to five optional parameters. It prints the debug message, prefixed
with "Debug:" and the class name, to the standard output device.
Example:
`$this->debug('Starting execution of %s', get_class($this))`
Return value
Type
Description
void
Tags
Name
Description
TODO
- change this method name to something more descriptive/accurate
getDebug(
)
:
void
Description
getDebug function.
Return value
Type
Description
void
Tags
Name
Description
access
public
getDebugOutputStyle(
)
:
void
Description
Gets the debug output style.
Return value
Type
Description
void
Tags
Name
Description
access
public
setDebug(
$status,
)
:
void
Description
setDebug function.
Arguments
Name
Type
Description
Default
$status
n/a
Return value
Type
Description
void
Tags
Name
Description
access
public
setDebugOutputStyle(
mixed
$state,
)
:
void
Description
Sets the debug output style.
Arguments
Name
Type
Description
Default
$state
mixed
Return value
Type
Description
void
Tags
Name
Description
access
public
to_string(
mixed
$x,
)
:
string
Description
Converts a value to an HTTP-displayable string form
Metadata The Metadata class represents either Server or Image metadata
Nova Nova is an abstraction layer for the OpenStack compute service.
ObjectStore Intermediate (abstract) class to implement shared
features of all object-storage classes
PersistentObject represents an object that has the ability to be
retrieved, created, updated, and deleted.
Service This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.
ServiceCatalogItem Holds information on a single service from the Service Catalog
Curl The CurlRequest class is a simple wrapper to CURL functions. Not only does
this permit stubbing of the interface as described under the HttpRequest
interface, it could potentially allow us to replace the interface methods
with other function calls in the future.
HttpRequestInterface The HttpRequest interface defines methods for wrapping CURL; this allows
those methods to be stubbed out for unit testing, thus allowing us to
test without actually making live calls.
Response
Blank The HttpResponse returns an object with status information, separated
headers, and any response body necessary.
Http The HttpResponse returns an object with status information, separated
headers, and any response body necessary.
Compute
Flavor The Flavor class represents a flavor defined by the Compute service
Image The Image class represents a stored machine image returned by the
Compute service.
Network The Network class represents a single virtual network
Server The Server class represents a single server node.
Record The Record class represents a single domain record
Service This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.
Subdomain The Subdomain is basically another domain, albeit one that is a child of
a parent domain. In terms of the code involved, the JSON is slightly
different than a top-level domain, and the parent is a domain instead of
the DNS service itself.
Database
Database This class represents a Database in the Rackspace "Red Dwarf"
database-as-a-service product.
Instance Instance represents an instance of DbService, similar to a Server in a
Compute service
Service The Rackspace Database As A Service (aka "Red Dwarf")
User This class represents a User in the Rackspace "Red Dwarf"
database-as-a-service product.
LoadBalancer
Algorithm sub-resource to manage algorithms (read-only)
AllowedDomain sub-resource to manage allowed domains
BillableLoadBalancer used to get a list of billable load balancers for a specific date range
LoadBalancer The LoadBalancer class represents a single load balancer
Protocol sub-resource to manage protocols (read-only)
Node information on a single node in the load balancer
NodeEvent a single node event, usually called as part of a Collection
Readonly This defines a read-only SubResource - one that cannot be created, updated,
or deleted. Many subresources are like this, and this simplifies their
class definitions.
Stats Stats returns statistics about the load balancer
SubResource SubResource is an abstract class that handles subresources of a
LoadBalancer object; for example, the
`/loadbalancers/{id}/errorpage`. Since most of the subresources are
handled in a similar manner, this consolidates the functions.
Curl The CurlRequest class is a simple wrapper to CURL functions. Not only does
this permit stubbing of the interface as described under the HttpRequest
interface, it could potentially allow us to replace the interface methods
with other function calls in the future.
DataObject A DataObject is an object in the ObjectStore
Database This class represents a Database in the Rackspace "Red Dwarf"
database-as-a-service product.
HttpRequestInterface The HttpRequest interface defines methods for wrapping CURL; this allows
those methods to be stubbed out for unit testing, thus allowing us to
test without actually making live calls.
Rackspace Rackspace extends the OpenStack class with support for Rackspace's
API key and tenant requirements.
Readonly This defines a read-only SubResource - one that cannot be created, updated,
or deleted. Many subresources are like this, and this simplifies their
class definitions.
Service This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.
Service The Compute class represents the OpenStack Nova service.
Service The Rackspace Database As A Service (aka "Red Dwarf")
Service This class defines a "service"—a relationship between a specific OpenStack
and a provided service, represented by a URL in the service catalog.
Stack The Stack class requires a CloudFormation template and may contain additional
parameters for that template.
Stats Stats returns statistics about the load balancer
SubResource SubResource is an abstract class that handles subresources of a
LoadBalancer object; for example, the
`/loadbalancers/{id}/errorpage`. Since most of the subresources are
handled in a similar manner, this consolidates the functions.
Subdomain The Subdomain is basically another domain, albeit one that is a child of
a parent domain. In terms of the code involved, the JSON is slightly
different than a top-level domain, and the parent is a domain instead of
the DNS service itself.