category |
Zend |
package |
Zend_Service |
subpackage |
Rackspace |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
inherited_from |
\Zend_Service_Rackspace_Abstract |
Methods
Constructor
__construct(string $user, string $key, string $authUrl = self::US_AUTH_URL
)
Inherited
You must pass the account and the Rackspace authentication key.
Optional: the authentication url (default is US)
Parameters
$user
string
$key
string
$authUrl
string
Authentication
authenticate() : boolean
Inherited
Copy an object from a container to another
copyObject(string $container_source, string $obj_source, string $container_dest, string $obj_dest, array $metadata = array()
, string $content_type = null
) : boolean
Parameters
$container_source
string
$obj_source
string
$container_dest
string
$obj_dest
string
$metadata
array
$content_type
string
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
Create a container
createContainer(string $container, array $metadata = array()
) : boolean | \Zend_Service_Rackspace_Files_Container
Parameters
$container
string
$metadata
array
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
\Zend_Service_Rackspace_Files_Container
Delete a container (only if it's empty)
deleteContainer(string $container) : boolean
Parameters
$container
string
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
Delete an object in a container
deleteObject(string $container, string $object) : boolean
Parameters
$container
string
$object
string
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
Enable the CDN for a container
enableCdnContainer(string $container, integer $ttl = self::CDN_TTL_MIN
) : array | boolean
Parameters
$container
string
$ttl
integer
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
array
boolean
Get authentication URL
getAuthUrl() : string
Inherited
Get all the CDN containers
getCdnContainers(array $options = array()
) : array | boolean
Parameters
$options
array
Returns
array
boolean
Get the CDN URL
getCdnUrl() : string | boolean
Inherited
Get a container
getContainer(string $container) : \Zend_Service_Rackspace_Files_Container | boolean
Parameters
$container
string
Returns
\Zend_Service_Rackspace_Files_Container
boolean
Get all the containers
getContainers(array $options = array()
) : \Zend_Service_Rackspace_Files_ContainerList | boolean
Parameters
$options
array
Returns
\Zend_Service_Rackspace_Files_ContainerList
boolean
Return the total count of containers
getCountContainers() : integer
Return the count of objects contained in all the containers
getCountObjects() : integer
Get the error code of the last HTTP call
getErrorCode() : \strig
Inherited
Get the error msg of the last HTTP call
getErrorMsg() : string
Inherited
get the HttpClient instance
getHttpClient() : \Zend_Http_Client
Inherited
Returns
\Zend_Http_Client
Get the metadata information of the accounts:
- total count containers
- size in bytes of all the containers
- total objects in all the containers
getInfoAccount() : array | boolean
Get the information of a Cdn container
getInfoCdnContainer(string $container) : array | boolean
Parameters
$container
string
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
array
boolean
Get user key
getKey() : string
Inherited
Get the management server URL
getManagementUrl() : string | boolean
Inherited
Get an object in a container
getObject(string $container, string $object, array $headers = array()
) : boolean | \Zend_Service_Rackspace_Files_Object
Parameters
$container
string
$object
string
$headers
array
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
\Zend_Service_Rackspace_Files_Object
Get all the objects of a container
getObjects(string $container, array $options = array()
) : boolean | \Zend_Service_Rackspace_Files_ObjectList
Returns a maximum of 10,000 object names.
Parameters
$container
string
$options
array
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
\Zend_Service_Rackspace_Files_ObjectList
Get whether we're using ServiceNet
getServiceNet() : boolean
Inherited
Return the size in bytes of all the containers
getSizeContainers() : integer
Get the storage URL
getStorageUrl() : string | boolean
Inherited
Get the authentication token
getToken() : string
Inherited
Get User account
getUser() : string
Inherited
Return true is the last call was successful
isSuccessful() : boolean
Inherited
Set the Authentication URL
setAuthUrl(string $url) : void
Inherited
Set the authentication key
setKey(string $key) : void
Inherited
Sets whether to use ServiceNet
setServiceNet(boolean $useServiceNet = true
)
Inherited
ServiceNet is Rackspace's internal network. Bandwidth on ServiceNet is
not charged.
Parameters
$useServiceNet
boolean
Set the user account
setUser(string $user) : void
Inherited
Store a file in a container
storeObject(string $container, string $object, string $content, array $metadata = array()
, string $content_type = null
) : boolean
Parameters
$container
string
$object
string
$content
string
$metadata
array
$content_type
string
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
Update the attribute of a CDN container
updateCdnContainer(string $container, integer $ttl = null
, boolean $cdn_enabled = null
, boolean $log = null
) : boolean
Parameters
$container
string
$ttl
integer
$cdn_enabled
boolean
$log
boolean
Exceptions
\Zend_Service_Rackspace_Exception |
|
Returns
boolean
HTTP call
httpCall(string $url, string $method, array $headers = array()
, $data = array()
, string $body = null
) : \Zend_Http_Response
Inherited
Parameters
$url
string
$method
string
$headers
array
$data
$body
string
Returns
\Zend_Http_Response
Properties
Authentication URL
$authUrl : string
HTTP error code
$errorCode : string
Error Msg
$errorMsg : string
$httpClient
$httpClient : \Zend_Http_Client
Rackspace Key
$key : string
Server management URL
$managementUrl : string
Storage URL
$storageUrl : string
Token of authentication
$token : string
Do we use ServiceNet?
$useServiceNet : boolean
Rackspace account name
$user : string
Constants
ACCOUNT_BYTES_USED
ACCOUNT_BYTES_USED = "X-Account-Bytes-Used"
ACCOUNT_CONTAINER_COUNT
ACCOUNT_CONTAINER_COUNT = "X-Account-Container-Count"
ACCOUNT_OBJ_COUNT
ACCOUNT_OBJ_COUNT = "X-Account-Object-Count"
AUTHTOKEN
AUTHTOKEN = "X-Auth-Token"
AUTHTOKEN_LEGACY
AUTHTOKEN_LEGACY = "X-Storage-Token"
CDNM_URL
CDNM_URL = "X-CDN-Management-Url"
CDN_ACL_REFERRER
CDN_ACL_REFERRER = "X-Referrer-ACL"
CDN_ACL_USER_AGENT
CDN_ACL_USER_AGENT = "X-User-Agent-ACL"
CDN_EMAIL
CDN_EMAIL = "X-Purge-Email"
CDN_ENABLED
CDN_ENABLED = "X-CDN-Enabled"
CDN_LOG_RETENTION
CDN_LOG_RETENTION = "X-Log-Retention"
CDN_SSL_URI
CDN_SSL_URI = "X-CDN-SSL-URI"
CDN_TTL
CDN_TTL = "X-TTL"
CDN_TTL_MAX
CDN_TTL_MAX = 1577836800
CDN_TTL_MIN
CDN_TTL_MIN = 900
CDN_URI
CDN_URI = "X-CDN-URI"
CONTAINER_BYTES_USE
CONTAINER_BYTES_USE = "X-Container-Bytes-Used"
CONTAINER_OBJ_COUNT
CONTAINER_OBJ_COUNT = "X-Container-Object-Count"
ERROR_CDN_TTL_OUT_OF_RANGE
ERROR_CDN_TTL_OUT_OF_RANGE = 'TTL must be a number in seconds, min is 900 sec and maximum is 1577836800 (50 years)'
ERROR_CONTAINER_EXIST
ERROR_CONTAINER_EXIST = 'The container already exists'
ERROR_CONTAINER_NOT_EMPTY
ERROR_CONTAINER_NOT_EMPTY = 'The container is not empty, I cannot delete it.'
ERROR_CONTAINER_NOT_FOUND
ERROR_CONTAINER_NOT_FOUND = 'The container was not found.'
ERROR_OBJECT_CHECKSUM
ERROR_OBJECT_CHECKSUM = 'Checksum of the file content failed'
ERROR_OBJECT_MISSING_PARAM
ERROR_OBJECT_MISSING_PARAM = 'Missing Content-Length or Content-Type header in the request'
ERROR_OBJECT_NOT_FOUND
ERROR_OBJECT_NOT_FOUND = 'The object was not found.'
ERROR_PARAM_NO_CONTENT
ERROR_PARAM_NO_CONTENT = 'You must specify the content of the object'
ERROR_PARAM_NO_NAME_CONTAINER
ERROR_PARAM_NO_NAME_CONTAINER = 'You must specify the container name'
ERROR_PARAM_NO_NAME_DEST_CONTAINER
ERROR_PARAM_NO_NAME_DEST_CONTAINER = 'You must specify the destination container name'
ERROR_PARAM_NO_NAME_DEST_OBJECT
ERROR_PARAM_NO_NAME_DEST_OBJECT = 'You must specify the destination object name'
ERROR_PARAM_NO_NAME_OBJECT
ERROR_PARAM_NO_NAME_OBJECT = 'You must specify the object name'
ERROR_PARAM_NO_NAME_SOURCE_CONTAINER
ERROR_PARAM_NO_NAME_SOURCE_CONTAINER = 'You must specify the source container name'
ERROR_PARAM_NO_NAME_SOURCE_OBJECT
ERROR_PARAM_NO_NAME_SOURCE_OBJECT = 'You must specify the source object name'
ERROR_PARAM_UPDATE_CDN
ERROR_PARAM_UPDATE_CDN = 'You must specify at least one the parameters: ttl, cdn_enabled or log_retention'
MANAGEMENT_URL
MANAGEMENT_URL = "X-Server-Management-Url"
STORAGE_URL
STORAGE_URL = "X-Storage-Url"
UK_AUTH_URL
UK_AUTH_URL = 'https://lon.auth.api.rackspacecloud.com'
USER_AGENT
USER_AGENT = 'Zend_Service_Rackspace'
US_AUTH_URL
US_AUTH_URL = 'https://auth.api.rackspacecloud.com'