Fork me on GitHub

Class base.blob.Container


Defined in: container.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
base.blob.Container(conn, attrs)

Container class.

Field Summary
Field Attributes Field Name and Description
 

Connection object.

 

Container name.

Method Summary
Method Attributes Method Name and Description
 
del(options)

DELETE a container.

 
delBlob(name, options)

Create blob object and DELETE.

 
get(options)

GET (or PUT) Container from cloud.

 
getBlob(name, options)

Create blob object and GET data.

 
getBlobs(options)

GET a list of blob objects.

 
getBlobToFile(name, filePath, options)

Create blob object and GET data to file.

 
headBlob(name, options)

Create blob object and HEAD headers, metadata.

 
put(options)

PUT container in cloud.

 
putBlob(name, options)

Create blob object and PUT data.

 
putBlobFromFile(name, filePath, options)

Create blob object and PUT data from file.

Event Summary
Event Attributes Event Name and Description
 
del_end(results, meta)

Completion event ('end').

 
del_error(err)

Error event ('error').

 
get_end(results, meta)

Completion event ('end').

 
get_error(err)

Error event ('error').

 
getBlobs_end(results, meta)

Completion event ('end').

 

Error event ('error').

Class Detail
base.blob.Container(conn, attrs)

Container class.

Parameters:
{base.blob.Container} conn
Connection object.
{Object} attrs
Attributes.
{string} attrs.name
Name.
{string} attrs.created
Creation date.
Field Detail
{base.Connection} connection

Connection object.


{string} name

Container name.

Method Detail

DELETE a container.

Events

Parameters:
{Object} options Optional
Options object.
{Object} options.headers Optional
Raw headers to add.
{Object} options.cloudHeaders Optional
Cloud provider headers to add.
{Object} options.metadata Optional
Cloud metadata to add.
Returns:
{request.AuthenticatedRequest} Request object.

delBlob(name, options)

Create blob object and DELETE.

Parameters:
name
options
See:
base.blob.Blob#del

GET (or PUT) Container from cloud.

Events

Note - Unvalidated GET's

If both validate and create are false, there is typically no actual network operation, just a dummy (and immediate) callback. Subsequent code cannot assume the container actually exists in the cloud and must handle 404's, etc.

Parameters:
{Object} options Optional
Options object.
{bool} options.validate Optional, Default: false
Validate?
{bool} options.create Optional, Default: false
Create (PUT) if doesn't exist?
{Object} options.headers Optional
Raw headers to add.
{Object} options.cloudHeaders Optional
Cloud provider headers to add.
Returns:
{request.AuthenticatedRequest} Request object.

getBlob(name, options)

Create blob object and GET data.

Parameters:
name
options
See:
base.blob.Blob#get

{request.AuthenticatedRequest} getBlobs(options)

GET a list of blob objects.

Events

Parameters:
{Object} options Optional
Options object.
{string} options.prefix Optional
Prefix of blob namespace to filter.
{string} options.delimiter Optional
Implied directory character.
{string} options.marker Optional
Starting blob name for next results.
{number} options.maxResults Optional, Default: 1000
Max. blobs to return.
{Object} options.headers Optional
Raw headers to add.
{Object} options.cloudHeaders Optional
Cloud provider headers to add.
{Object} options.metadata Optional
Cloud metadata to add.
Returns:
{request.AuthenticatedRequest} Request object.

getBlobToFile(name, filePath, options)

Create blob object and GET data to file.

Parameters:
name
filePath
options
See:
base.blob.Blob#getToFile

headBlob(name, options)

Create blob object and HEAD headers, metadata.

Parameters:
name
options
See:
base.blob.Blob#head

put(options)

PUT container in cloud.

Alias of get() with 'create=true' option.

Parameters:
options
See:
base.blob.Container#get

putBlob(name, options)

Create blob object and PUT data.

Parameters:
name
options
See:
base.blob.Blob#put

putBlobFromFile(name, filePath, options)

Create blob object and PUT data from file.

Parameters:
name
filePath
options
See:
base.blob.Blob#putFromFile
Event Detail
del_end(results, meta)

Completion event ('end').

Event emission / callback indicates the object no longer exists.

Parameters:
{Object} results
Results object.
{base.blob.Container} results.container
Container object.
{boolean} results.notFound
True if object was not found.
{Object} meta
Headers, meta object.
{Object} meta.headers Optional
HTTP headers.
{Object} meta.cloudHeaders Optional
Cloud provider headers.
{Object} meta.metadata Optional
Cloud metadata.

del_error(err)

Error event ('error').

Parameters:
{Error|errors.CloudError} err
Error object.

get_end(results, meta)

Completion event ('end').

Parameters:
{Object} results
Results object.
{base.blob.Container} results.container
Container object.
{boolean} results.alreadyCreated
True if object already exists. Note: Not all providers can tell.
{Object} meta
Headers, meta object.
{Object} meta.headers Optional
HTTP headers.
{Object} meta.cloudHeaders Optional
Cloud provider headers.
{Object} meta.metadata Optional
Cloud metadata.

get_error(err)

Error event ('error').

Parameters:
{Error|errors.CloudError} err
Error object.

getBlobs_end(results, meta)

Completion event ('end').

Parameters:
{Object} results
Results object.
{Array} results.blobs
List of blob objects.
{Array} results.dirNames
List of pseudo-directory name strings.
{boolean} results.hasNext
True if more results are available.
{Object} meta
Headers, meta object.
{Object} meta.headers Optional
HTTP headers.
{Object} meta.cloudHeaders Optional
Cloud provider headers.
{Object} meta.metadata Optional
Cloud metadata.

getBlobs_error(err)

Error event ('error').

Parameters:
{Error|errors.CloudError} err
Error object.