swifft
An OpenStack Swift Client npm module and CLI.
Basic Usage
Programmatic API
; // These are the default env vars used internally by swifft.// Usage here is for demonstration purposes only.let options = auth_url = processenvOS_AUTH_URL tenant_id = processenvOS_TENANT_ID tenant_name = processenvOS_TENANT_NAME endpoint_type = processenvOS_ENDPOINT_TYPE region = processenvOS_REGION_NAME username = processenvOS_USERNAME password = processenvOS_PASSWORD let account = Swifft; // List containersaccount;
CLI
$ source ~/openrc.sh $ swifft list[
API
Swifft
create([options])
Returns an Account instance.
Account
getMetadata(callback)
Retrieve metadata for the current account.
updateMetadata(metadata, callback)
Set metadata for the current account.
list([options], callback)
List containers for the current account.
container(name)
Get the named container. Returns a Container instance.
Container
create([settings], callback)
Create the named container.
getMetadata(callback)
Retrieve metadata for the current container.
updateMetadata(metadata, callback)
Set metadata for the current container.
list([options], callback)
List objects in the current container.
delete(callback)
Delete the current container.
object(name)
Get the named object. returns an Object instance.
Object
create([settings], callback)
Create the named Object.
get(callback)
Get the contents and settings of the current object.
getStream([range,] callback)
Get the contents as a readable stream and settings of the current object. See Object Storage API Docs for valid Range values.
getRange(range, callback)
Get the contents as a readable range and settings of the current object. See Object Storage API Docs for valid Range values.
getMetadata(callback)
Retrieve metadata for the current object.
updateMetadata(metadata, callback)
Set metadata for the current object.
copy(dest, callback)
Copy the current object to the provided destination: { container, object }.
delete(callback)
Delete the current object.