1.0.4 • Published 7 years ago

selectel-storage-promise v1.0.4

Weekly downloads
3
License
UNLICENSED
Repository
github
Last release
7 years ago

Modules

Classes

Selectel

Manage Selectel's storage Selectel's Documentation

Selectel

Kind: global class

new Selectel(request, requestPromise)

Constructor function.

ParamType
requestObject
requestPromiseObject

selectel.auth(login, pass) ⇒ Promise

Gets the authentication token (key) for accessing storage and sets it internally.

Kind: instance method of Selectel

ParamTypeDescription
loginstringaccount number
passstringstorage password

selectel.info() ⇒ Promise

Returns general information about account: total number of containers, total number of objects, total volume of data stored, total volume of data downloaded.

Kind: instance method of Selectel

selectel.fetchContainers(format, limit, marker) ⇒ Promise

Returns the list of available containers.

Kind: instance method of Selectel

ParamTypeDescription
formatstring'json' or 'xml', 'json' is the default value
limitstringthe maximum number of objects on a list (default - 10 000)
markerstringthe name of the final container from the previous request

selectel.createContainer(containerName, containerType) ⇒ Promise

Creates a new container.

Kind: instance method of Selectel

ParamTypeDescription
containerNamestringname of the container
containerTypestringcontainer type: 'public', 'private' or 'gallery'. 'public' is the default value

selectel.infoContainer(containerName) ⇒ Promise

Returns a container's information.

Kind: instance method of Selectel

ParamTypeDescription
containerNamestringname of the container

selectel.editContainer(containerName, containerType) ⇒ Promise

Changes a container's metadata.

Kind: instance method of Selectel

ParamTypeDescription
containerNamestringname of the container
containerTypestringcontainer type: 'public', 'private' or 'gallery'

selectel.deleteContainer(containerName) ⇒ Promise

Deletes the container.

Kind: instance method of Selectel

ParamTypeDescription
containerNamestringname of the container

selectel.fetchFiles(containerName, params) ⇒ Promise

Returns a list of files stored in the container.

Kind: instance method of Selectel

ParamTypeDescription
containerNamestringname of the container
paramsObjectparameters.
params.formatstringthe format results are returned in (json or xml)
params.limitstringthe maximum number of objects on a list (default - 10 000)
params.markerstringobjects whose value exceeds the given marker (useful for page navigation and for large numbers of files)
params.prefixstringprints objects whose names start with the given prefix in line format
params.pathstringreturns objects in the given folder (virtual folder)
params.delimiterstringreturns objects up to the given delimiter in the filename

selectel.uploadFile(fullLocalPath, hostingPath, additionalHeaders) ⇒ Promise

Uploads a file to the container.

Kind: instance method of Selectel

ParamTypeDescription
fullLocalPathstringfull local path to the file
hostingPathstring/{container}/{file}
additionalHeadersObject{ X-Delete-At: ..., X-Delete-After: ..., Etag: ..., X-Object-Meta: ... }

selectel.extractArchive(readStream, hostingPath, arhFormat) ⇒ Promise

Extracts the archive.

Kind: instance method of Selectel

ParamTypeDescription
readStreampiperead stream
hostingPathstring/{container}/{file}
arhFormatstringThe archive type: 'tar', 'tar.gz' or 'tar.bz2'

selectel.copyFile(hostingPath, newPath) ⇒ Promise

Copies a file to the given folder.

Kind: instance method of Selectel

ParamTypeDescription
hostingPathstring/{container}/{file}
newPathstring/{container}/{new-file}

selectel.deleteFile(filePath) ⇒ Promise

Deletes the given file.

Kind: instance method of Selectel

ParamTypeDescription
filePathstring/{container}/{file}