seaweed_master: Seaweed Master API

Description Methods

Description

Create a seaweed_master object for interacting with SeaweedFS master API

See https://github.com/chrislusf/seaweedfs/wiki/Master-Server-API for details

Methods

Public methods


Method new()

Create client object for sending http requests to seaweed master

Usage
seaweed_master$new(seaweed_url)
Arguments
seaweed_url

Root URL of Seaweed master

Returns

A new seaweed_master object


Method assign()

Assign a file key.

Increase a number in master server's memory and return fid, volume server url and volume server public URL. Can be used to to upload a file to <publicUrl>/<fid>.

Usage
seaweed_master$assign(collection = NULL)
Arguments
collection

Collection name, acts as a namespace for files.

Returns

fid, volume server URL and volume server public URL


Method lookup()

Lookup volume

Look up volumes by ID or by file ID to get volume URL. Volumes might move so we need to lookup their URL to get up to date location.

Usage
seaweed_master$lookup(id, collection = NULL)
Arguments
id

volume ID or file ID to locate volume for

collection

Optional collection name this volume belongs to.

Returns

List of seaweed_volume() objects representing the volumes


Method delete_collection()

Delete a collection of files

Usage
seaweed_master$delete_collection(collection)
Arguments
collection

Collection name.

Returns

Nothing, called for side effects


Method upload()

Upload file to SeaweedFS

Usage
seaweed_master$upload(path)
Arguments
path

Path to file to be uploaded

Returns

The uploaded location, name, URL and size


mrc-ide/kelp documentation built on Dec. 21, 2021, 10:04 p.m.