Rackspace Cloudfiles Module

API Docs for: 1.0.1
Show:

Container Class

Module: Readme

Methods

cancelUpload

(
  • params
)
Void

Available since 1.0.0

Cancels the uploading of the object.

Parameters:

  • params Object
    • [uploadId] Number optional

      The ID of the upload to be cancelled. Optional; if not provided, the last upload will be cancelled.

Returns:

Void:

deleteObject

(
  • params
)
Void

Available since 1.0.0

Deletes an object. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • [name] String optional

      Name of the object. Optional, but either this, or the object parameter must be specified.

    • [object] Object optional

      An Object object. Optional, but either this, or the name parameter must be specified.

    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

Returns:

Void:

disableCdn

(
  • params
)
Void

Available since 1.0.0

Disables CDN for the container. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

Returns:

Void:

enableCdn

(
  • params
)
Void

Available since 1.0.0

Enables CDN for the container. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • success Function

      Callback to call in case of success. The function receives the container's CDN metadata as parameters.

    • error Function

      Callback to call in case of error.

Returns:

Void:

getCdnMetadata

(
  • params
)
Void

Available since 1.0.0

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 Function

      Callback to call in case of success. The function receives a dictionary as parameter. The dictionary holds the pieces of metadata with their respective names as keys.

    • error Function

      Callback to call in case of error.

Returns:

Void:

getMetadata

(
  • params
)
Void

Available since 1.0.0

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 Function

      Callback to call in case of success. The function receives a dictionary as parameter. The dictionary holds the pieces of metadata with their respective names as keys.

    • error Function

      Callback to call in case of error.

Returns:

Void:

getObject

(
  • name
)
Object

Available since 1.0.0

Creates an Object object by name.

Parameters:

  • name String

    Name of the object.

Returns:

Object:

getObjects

(
  • params
)
Void

Available since 1.0.0

Retrieves the objects in this container. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • success Function

      Callback 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 Function

      Callback to call in case of error.

Returns:

Void:

isCdnEnabled

() Boolean

Available since 1.0.0

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 object retrieved using the getContainers function will not have any CDN related information attached to it and will report false when this function is called until the getCdnMetadata function is called.

Call the getCdnMetadata function to refresh this information.

Returns:

Boolean:

isLogRetentionEnabled

() Boolean

Available since 1.0.0

Returns true if log retention is enabled as far as the module knows.

Call the getCdnMetadata function to refresh this information.

Returns:

Boolean:

toString

() String

Available since 1.0.0

Returns a string representation of this container.

Returns:

String:

updateCdnMetadata

(
  • params
)
Void

Available since 1.0.0

Updates the CDN metadata associated with this container. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • metadata Object

      A 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 Function

      Callback to call in case of success. The function receives does not receive any parameters.

    • error Function

      Callback to call in case of error.

Returns:

Void:

updateMetadata

(
  • params
)
Void

Available since 1.0.0

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 is difference is inherent in the Rackspace CloudFiles web API.

Parameters:

  • params Object
    • metadata Object

      A dictionary that holds the metadata as key/value pairs.

    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

Returns:

Void:

updateVersionsLocation

(
  • params
)
Void

Available since 1.0.0

Updates the versions location of this container. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • versionsLocation String

      The name of the container used for versioning.

    • success Function

      Callback to call in case of success. The function receives does not receive any parameters.

    • error Function

      Callback to call in case of error.

Returns:

Void:

uploadObject

(
  • params
)
Number

Available since 1.0.0

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 String

      Name of the object.

    • [media] Ti.Blob optional

      The content to be uploaded. Optional, but either this or the file parameter must be specified.

    • [file] Ti.File optional

      The content to be uploaded. Optional, but either this or the media parameter must be specified.

    • [metadata] Object optional

      The metadata to be associated with the uploaded object.

    • [deleteAt] Date optional

      The date after the object should be deleted.

    • [deleteAfter] Number optional

      The number of seconds after which the object should be deleted.

    • [contentType] String optional

      The object's content type. Although this parameter is optional, content type will always be set to something. If the media is specified, then media.mimeType will be the default content type. Otherwise the default is binary/octet-stream.

    • success Function

      Callback 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 Function

      Callback to call in case of error.

    • [progress] Function optional

      Callback to call to report progress. It has a single float parameter between the values 0.0 and 1.0.

Returns:

Number:

Properties

cdnIosUri

String read-only

Available since 1.0.0

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

Available since 1.0.0

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

Available since 1.0.0

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

Available since 1.0.0

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

Available since 1.0.0

Metadata associated with the container.

Call the getMetadata function to refresh this property.

name

String read-only

Available since 1.0.0

The name of the container.

objectCount

Number read-only

Available since 1.0.0

The number of objects in the container.

Call the getMetadata function to refresh this property.

totalBytesUsed

Number read-only

Available since 1.0.0

Total bytes used by the container.

Call the getMetadata function to refresh this property.

ttl

Number read-only

Available since 1.0.0

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

Available since 1.0.0

The name of the container used for versioning.

Call the getMetadata function to refresh this property.