Skip to content

Client

Classes

ServerInfo_1
Client

ServerInfo_1

Kind: global class

new ServerInfo_1()

Represents HTTP Client for ReductStore API

Client

Kind: global class

new Client(url, options)

HTTP Client for ReductStore

Param Description
url URL to the storage
options

client.getInfo() ⇒ Promise.<ServerInfo>

Get server information

Kind: instance method of Client
Returns: Promise.<ServerInfo> - the data about the server

client.getBucketList() ⇒ Array.<BucketInfo>

Get list of buckets

Kind: instance method of Client
See: BucketInfo

client.createBucket(name, settings) ⇒ Promise.<Bucket>

Create a new bucket

Kind: instance method of Client

Param Description
name name of the bucket
settings optional settings

client.getBucket(name) ⇒ Promise.<Bucket>

Get a bucket by name

Kind: instance method of Client

Param Description
name name of the bucket

client.getOrCreateBucket(name, settings) ⇒ Promise.<Bucket>

Try to create a bucket and get it if it already exists

Kind: instance method of Client

Param Description
name name of the bucket
settings optional settings

client.createToken(name, permissions) ⇒ Promise.<string>

Create a new access token

Kind: instance method of Client
Returns: Promise.<string> - the token

Param Description
name name of the token
permissions permissions for the token

Example

const token = await client.createToken("my-token", {fullAccess: true});
const client = new Client("https://play.storage-reduct.dev", {apiToken: token});

client.getToken(name) ⇒ Promise.<Token>

Get a token by name

Kind: instance method of Client
Returns: Promise.<Token> - the token

Param Description
name name of the token

client.getTokenList() ⇒ Promise.<Array.<Token>>

List all tokens

Kind: instance method of Client
Returns: Promise.<Array.<Token>> - the list of tokens

client.deleteToken(name)

Delete a token by name

Kind: instance method of Client

Param Description
name name of the token

client.me() ⇒ Promise.<Token>

Get current API token and its permissions

Kind: instance method of Client
Returns: Promise.<Token> - the token

client.getReplicationList() ⇒ Promise.<Array.<ReplicationInfo>>

Get the list of replications

Kind: instance method of Client
Returns: Promise.<Array.<ReplicationInfo>> - the list of replications

client.getReplication(name) ⇒ Promise.<FullReplicationInfo>

Get full information about a replication

Kind: instance method of Client
Returns: Promise.<FullReplicationInfo> - the replication

Param Description
name name of the replication

client.createReplication(name, settings) ⇒ Promise.<void>

Create a new replication

Kind: instance method of Client

Param Description
name name of the replication
settings settings of the replication

client.updateReplication(name, settings) ⇒ Promise.<void>

Update a replication

Kind: instance method of Client

Param Description
name name of the replication
settings settings of the replication

client.deleteReplication(name) ⇒ Promise.<void>

Delete a replication

Kind: instance method of Client

Param Description
name name of the replication