Container Class
Item Index
Methods
Methods
cancelUpload
-
params
Cancels the uploading of the object.
Parameters:
-
params
Object-
[uploadId]
Number optionalThe ID of the upload to be cancelled. Optional; if not provided, the last upload will be cancelled.
-
Returns:
deleteObject
-
params
Deletes an object. This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
[name]
String optionalName of the object. Optional, but either this, or the
object
parameter must be specified. -
[object]
Object optionalAn Object object. Optional, but either this, or the
name
parameter must be specified. -
success
FunctionCallback to call in case of success.
-
error
FunctionCallback to call in case of error.
-
Returns:
disableCdn
-
params
Disables CDN for the container. This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
success
FunctionCallback to call in case of success.
-
error
FunctionCallback to call in case of error.
-
Returns:
enableCdn
-
params
Enables CDN for the container. This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
success
FunctionCallback to call in case of success.
-
error
FunctionCallback to call in case of error.
-
Returns:
getCdnMetadata
-
params
Retrieves the CDN metadata associated with this container. This is an
async call. The retrieved data will be stored in the properties of
the Container
object, which will be returned to the
success
callback as the source
property of its
parameter object.
See also the getMetadata function.
Parameters:
-
params
Object-
success
FunctionCallback to call in case of success.
-
error
FunctionCallback to call in case of error.
-
Returns:
getMetadata
-
params
Retrieves the metadata associated with this container. This is an
async call. The retrieved data will be stored in the properties of
the Container
object, which will be returned to the
success
callback as the source
property of its
parameter object.
See also the getCdnMetadata function.
Parameters:
-
params
Object-
success
FunctionCallback to call in case of success.
-
error
FunctionCallback to call in case of error.
-
Returns:
getObject
-
name
Creates an Object object by name.
Parameters:
-
name
StringName of the object.
Returns:
getObjects
-
params
Retrieves the objects in this container. This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
success
FunctionCallback to call in case of success. The function receives a dictionary as parameter. The dictionary stores an array of Objects under the
objects
key. -
error
FunctionCallback to call in case of error.
-
Returns:
isCdnEnabled
()
Boolean
Returns true
if the container is CDN enabled as far
as the module knows.
Note that the status of the container object
in memory does not necessarily reflect the status of the container
on the Cloud Files server. In particular, Container
objects
retrieved using the
getContainers function
will not have any CDN related information attached to them and will
report false
when this function is called until the
getCdnMetadata function
is called on them.
See the documentation of the getMetadata and getCdnMetadata methods and the Readme for more detail on this.
Returns:
isLogRetentionEnabled
()
Boolean
Returns true
if log retention is enabled
as far as the module knows.
Call the getCdnMetadata function to refresh this information.
Returns:
toString
()
String
Returns a string representation of this container.
Returns:
updateCdnMetadata
-
params
Updates the CDN metadata associated with this container. This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
metadata
ObjectA dictionary that holds the metadata as key/value pairs. Possible values:
- enable: Boolean; enables or disables CDN for this container.
- logRetention: Boolean enables or disables log retention for this container.
- ttl: Number; time-to-live value for this container.
-
success
FunctionCallback to call in case of success. The function receives does not receive any parameters.
-
error
FunctionCallback to call in case of error.
-
Returns:
updateMetadata
-
params
Updates the metadata associated with this container. This is an async call that returns the results in a callback.
Unlike the updateMetadata function of the Object class, this function does not automatically overwrite all existing metadata; if you need to remove some metadata, you must set its value to an empty string. This difference is inherent in the Rackspace CloudFiles web API.
Parameters:
-
params
Object-
metadata
ObjectA dictionary that holds the metadata as key/value pairs.
-
success
FunctionCallback to call in case of success.
-
error
FunctionCallback to call in case of error.
-
Returns:
updateVersionsLocation
-
params
Updates the versions location of this container. This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
versionsLocation
StringThe name of the container used for versioning.
-
success
FunctionCallback to call in case of success. The function receives does not receive any parameters.
-
error
FunctionCallback to call in case of error.
-
Returns:
uploadObject
-
params
Uploads an object. Returns an upload ID number that can be used to cancel the upload using the cancelUpload function.
This is an async call that returns the results in a callback.
Parameters:
-
params
Object-
name
StringName of the object.
-
[media]
Ti.Blob optionalThe content to be uploaded. Optional, but either this or the
file
parameter must be specified. -
[file]
Ti.File optionalThe content to be uploaded. Optional, but either this or the
media
parameter must be specified. -
[metadata]
Object optionalThe metadata to be associated with the uploaded object.
-
[deleteAt]
Date optionalThe date after the object should be deleted.
-
[deleteAfter]
Number optionalThe number of seconds after which the object should be deleted.
-
[contentType]
String optionalThe object's content type. Although this parameter is optional, content type will always be set to something. If the
media
is specified, thenmedia.mimeType
will be the default content type. Otherwise the default isbinary/octet-stream
. -
success
FunctionCallback to call in case of success. Beside the default parameters, the function receives an Object object (under the
object
key), which represents the object just created. -
error
FunctionCallback to call in case of error.
-
[progress]
Function optionalCallback to call to report progress. It has a single float parameter between the values 0.0 and 1.0.
-
Returns:
Properties
cdnIosUri
String
read-only
The iOS URI of the container if the container is CDN enabled as far as the module knows.
Call the getCdnMetadata function to refresh this property.
cdnSslUri
String
read-only
The SSL CDN URI of the container if the container is CDN enabled as far as the module knows.
Call the getCdnMetadata function to refresh this property.
cdnStreamingUri
String
read-only
The streaming URI of the container if the container is CDN enabled as far as the module knows.
Call the getCdnMetadata function to refresh this property.
cdnUri
String
read-only
The CDN URI of the container if the container is CDN enabled as far as the module knows.
Call the getCdnMetadata function to refresh this property.
metadata
Dictionary
read-only
Metadata associated with the container.
Call the getMetadata function to refresh this property.
name
String
read-only
The name of the container.
objectCount
Number
read-only
The number of objects in the container.
Call the getMetadata function to refresh this property.
totalBytesUsed
Number
read-only
Total bytes used by the container.
Call the getMetadata function to refresh this property.
ttl
Number
read-only
The TTL value of the container if the container is CDN enabled as far as the module knows.
Call the getCdnMetadata function to refresh this property.
versionsLocation
String
read-only
The name of the container used for versioning.
Call the getMetadata function to refresh this property.