MEMO Storage
  • Introduction
    • MEMO and MEFS
      • MEMO Website
    • Concepts
      • Characteristics and Advantages
      • How to check the balance
      • How to Pledge MEMO
      • MEMO TOKEN ECONOMICS
      • Payment of Memo
      • Requirements
      • Role Introduction
    • Version Introduction
      • Version1-Phecda
      • Version2-Megrez
        • Difference from Phecda
      • Latest Version-Megrez 2.5
  • Start Usage
    • Start user in windows
    • Start user in docker
      • How to start
      • How to use
        • Bucket Operation
        • Upload and Download
    • Start provider in docker
      • How to start
      • Hardware Recommendation
    • How to use user
    • Gateway Mode
    • HTTP Operation
    • Docker Installation
      • For Windows
      • For Linux
  • Commandline Usage
    • Keeper Commandline Mannual
    • Provider Commandline Mannual
    • User Commandline Mannual
  • FAQ
    • Check Log File
    • Common
    • Connection
    • Startup problems
    • Disconnection problems
    • Others
    • Q&A for V1
      • Common
      • User
      • Provider
      • Check Log File
      • Others
  • RAFI
  • Version Update
    • Upgrade to Megrez2.5
    • Volunteer Recruitment Plan
  • Resources
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Start Usage

HTTP Operation

Mefs commands can all be operated using HTTP.

Configuration

Before mefs-user starts, confirm the following configuration is set in the config.json:

// mefs api port setting, default is 5001

api.address is set to: /ip4/0.0.0.0/tcp/5001

// cross-domain access

api.accessControlAllowOrigin is set to: ["*"]

api.accessControlAllowMethods is set to: ["PUT","GET", "POST"]

Then restart mefs-user to use HTTP to operate.

Usage

A command similar to the following:

mefs-user rootcmd subcmd <arg1> <arg2> -opname1=<op1> -opname2=<op2>

The corresponding HTTP request is:

curl "http://<ip>:<port>/api/v0/<rootcmd>/<subcmd>?arg=<arg1>&arg=<arg2>&opname1=<op1>&opname2=<op2>"

IP is the network address of the machine where mefs-user is started. The port defaults to 5001. If cross-domain access is configured before running, you can use the external network IP to access, otherwise you can only access it through 127.0.0.1.

curl "http://127.0.0.1:5001/api/v0/lfs/list_buckets?addr=<public key>"

The output is in standard JSON format:

  {
    "Method": "List Buckets",
    "Buckets": [
      {
        "BucketName": "<BucketName>",
        "BucketID": "<BucketID>",
        "Ctime": "<Ctime>",
        "Policy": "<Policy>",
        "DataCount": "<DataCount>",
        "ParityCount": "<ParityCount>"
      },
      {
        "BucketName": "<BucketName>",
        "BucketID": "<BucketID>",
        "Ctime": "<Ctime>",
        "Policy": "<Policy>",
        "DataCount": "<DataCount>",
        "ParityCount": "<ParityCount>"
      }
    ]
  }
curl "http://127.0.0.1:5001/api/v0/lfs/list_objects?arg=<BucketName>&addr=<public key>"

The output is in standard JSON format:

{
  "Method": "List Objects",
  "Objects": [
    {
      "ObjectName": "<ObjectName>",
      "ObjectSize": "<ObjectSize>",
      "Ctime": "<Ctime>",
      "Dir": "<Dir>",
      "LatestChalTime": "<LatestChalTime>"
    },
    {
      "ObjectName": "<ObjectName>",
      "ObjectSize": "<ObjectSize>",
      "Ctime": "<Ctime>",
      "Dir": "<Dir>",
      "LatestChalTime": "<LatestChalTime>"
    }
  ]
}
PreviousGateway ModeNextDocker Installation

Last updated 1 year ago

Was this helpful?

Example
Show all bucket information
Display Information about All Objects in a Bucket