Modules
- Selectel
Manage Selectel's storage Selectel's Documentation
Classes
Selectel
Manage Selectel's storage Selectel's Documentation
Selectel
Kind: global class
- Selectel
- new Selectel(request, requestPromise)
- .auth(login, pass) ⇒
Promise
- .info() ⇒
Promise
- .fetchContainers(format, limit, marker) ⇒
Promise
- .createContainer(containerName, containerType) ⇒
Promise
- .infoContainer(containerName) ⇒
Promise
- .editContainer(containerName, containerType) ⇒
Promise
- .deleteContainer(containerName) ⇒
Promise
- .fetchFiles(containerName, params) ⇒
Promise
- .uploadFile(fullLocalPath, hostingPath, additionalHeaders) ⇒
Promise
- .extractArchive(readStream, hostingPath, arhFormat) ⇒
Promise
- .copyFile(hostingPath, newPath) ⇒
Promise
- .deleteFile(filePath) ⇒
Promise
new Selectel(request, requestPromise)
Constructor function.
Param | Type |
---|---|
request | Object |
requestPromise | Object |
Promise
selectel.auth(login, pass) ⇒ Gets the authentication token (key) for accessing storage and sets it internally.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
login | string |
account number |
pass | string |
storage password |
Promise
selectel.info() ⇒ 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
Promise
selectel.fetchContainers(format, limit, marker) ⇒ Returns the list of available containers.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
format | string |
'json' or 'xml', 'json' is the default value |
limit | string |
the maximum number of objects on a list (default - 10 000) |
marker | string |
the name of the final container from the previous request |
Promise
selectel.createContainer(containerName, containerType) ⇒ Creates a new container.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
containerName | string |
name of the container |
containerType | string |
container type: 'public', 'private' or 'gallery'. 'public' is the default value |
Promise
selectel.infoContainer(containerName) ⇒ Returns a container's information.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
containerName | string |
name of the container |
Promise
selectel.editContainer(containerName, containerType) ⇒ Changes a container's metadata.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
containerName | string |
name of the container |
containerType | string |
container type: 'public', 'private' or 'gallery' |
Promise
selectel.deleteContainer(containerName) ⇒ Deletes the container.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
containerName | string |
name of the container |
Promise
selectel.fetchFiles(containerName, params) ⇒ Returns a list of files stored in the container.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
containerName | string |
name of the container |
params | Object |
parameters. |
params.format | string |
the format results are returned in (json or xml) |
params.limit | string |
the maximum number of objects on a list (default - 10 000) |
params.marker | string |
objects whose value exceeds the given marker (useful for page navigation and for large numbers of files) |
params.prefix | string |
prints objects whose names start with the given prefix in line format |
params.path | string |
returns objects in the given folder (virtual folder) |
params.delimiter | string |
returns objects up to the given delimiter in the filename |
Promise
selectel.uploadFile(fullLocalPath, hostingPath, additionalHeaders) ⇒ Uploads a file to the container.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
fullLocalPath | string |
full local path to the file |
hostingPath | string |
/{container}/{file} |
additionalHeaders | Object |
{ X-Delete-At: ..., X-Delete-After: ..., Etag: ..., X-Object-Meta: ... } |
Promise
selectel.extractArchive(readStream, hostingPath, arhFormat) ⇒ Extracts the archive.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
readStream | pipe |
read stream |
hostingPath | string |
/{container}/{file} |
arhFormat | string |
The archive type: 'tar', 'tar.gz' or 'tar.bz2' |
Promise
selectel.copyFile(hostingPath, newPath) ⇒ Copies a file to the given folder.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
hostingPath | string |
/{container}/{file} |
newPath | string |
/{container}/{new-file} |
Promise
selectel.deleteFile(filePath) ⇒ Deletes the given file.
Kind: instance method of Selectel
Param | Type | Description |
---|---|---|
filePath | string |
/{container}/{file} |