mirror of
https://gitee.com/sjqzhang/go-fastdfs.git
synced 2024-12-02 03:08:11 +08:00
752 lines
21 KiB
HTML
752 lines
21 KiB
HTML
|
||
<!DOCTYPE HTML>
|
||
<html lang="" >
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||
<title>管理API · GitBook</title>
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||
<meta name="description" content="">
|
||
<meta name="generator" content="GitBook 3.2.3">
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="gitbook/style.css">
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<meta name="HandheldFriendly" content="true"/>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
|
||
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
|
||
|
||
|
||
<link rel="next" href="QA.html" />
|
||
|
||
|
||
<link rel="prev" href="breakpoint.html" />
|
||
|
||
|
||
</head>
|
||
<body>
|
||
|
||
<div class="book">
|
||
<div class="book-summary">
|
||
|
||
|
||
<div id="book-search-input" role="search">
|
||
<input type="text" placeholder="Type to search" />
|
||
</div>
|
||
|
||
|
||
<nav role="navigation">
|
||
|
||
|
||
|
||
<ul class="summary">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="chapter " data-level="1.1" data-path="./">
|
||
|
||
<a href="./#vision">
|
||
|
||
|
||
愿景
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.2" data-path="./">
|
||
|
||
<a href="./#background">
|
||
|
||
|
||
背景
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.2.1" data-path="./">
|
||
|
||
<a href="./#what">
|
||
|
||
|
||
go-fastdfs是什么?
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.3" data-path="./">
|
||
|
||
<a href="./#character">
|
||
|
||
|
||
特性
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.3.1" data-path="./">
|
||
|
||
<a href="./#advantage">
|
||
|
||
|
||
go-fastdfs优点
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.4" data-path="install.html">
|
||
|
||
<a href="install.html">
|
||
|
||
|
||
安装
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.4.1" data-path="install.html">
|
||
|
||
<a href="install.html#quick">
|
||
|
||
|
||
极速体验
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.4.2" data-path="install.html">
|
||
|
||
<a href="install.html#docker">
|
||
|
||
|
||
Docker体验
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.4.3" data-path="install.html">
|
||
|
||
<a href="install.html#compiler_install">
|
||
|
||
|
||
编译安装
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.4.4" data-path="install.html">
|
||
|
||
<a href="install.html#small-cluster">
|
||
|
||
|
||
小集群安装
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.4.5" data-path="install.html">
|
||
|
||
<a href="install.html#big-cluster">
|
||
|
||
|
||
海量集群安装(推荐)
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.4.6" data-path="ca.html">
|
||
|
||
<a href="ca.html">
|
||
|
||
|
||
https证书生成
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.5" data-path="authentication.html">
|
||
|
||
<a href="authentication.html">
|
||
|
||
|
||
认证
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.5.1" data-path="authentication.html">
|
||
|
||
<a href="authentication.html#fingerprint">
|
||
|
||
|
||
按文件指纹认证
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.5.2" data-path="authentication.html">
|
||
|
||
<a href="authentication.html#google">
|
||
|
||
|
||
按google认证码认证
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.5.3" data-path="authentication.html">
|
||
|
||
<a href="authentication.html#custom">
|
||
|
||
|
||
用户自定义认证
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.6" data-path="usage.html">
|
||
|
||
<a href="usage.html">
|
||
|
||
|
||
语言"SDK"
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.6.1" data-path="usage.html">
|
||
|
||
<a href="usage.html#description">
|
||
|
||
|
||
统一说明(重要)
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.6.2" data-path="usage.html">
|
||
|
||
<a href="usage.html#cmdline">
|
||
|
||
|
||
命令行上传
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.6.3" data-path="usage.html">
|
||
|
||
<a href="usage.html#web">
|
||
|
||
|
||
浏览器上传
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.6.4" data-path="usage.html">
|
||
|
||
<a href="usage.html#python">
|
||
|
||
|
||
Python语言
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.6.5" data-path="usage.html">
|
||
|
||
<a href="usage.html#go">
|
||
|
||
|
||
GO使用
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.6.6" data-path="usage.html">
|
||
|
||
<a href="usage.html#java">
|
||
|
||
|
||
Java语言
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.6.6.1" data-path="usage.html">
|
||
|
||
<a href="usage.html#java-stream">
|
||
|
||
|
||
Java流上传
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.7" data-path="breakpoint.html">
|
||
|
||
<a href="breakpoint.html#go">
|
||
|
||
|
||
断点续传"SDK"
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.7.1" data-path="breakpoint.html">
|
||
|
||
<a href="breakpoint.html#go">
|
||
|
||
|
||
GO
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.7.2" data-path="breakpoint.html">
|
||
|
||
<a href="breakpoint.html#js">
|
||
|
||
|
||
Javascript
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter active" data-level="1.8" data-path="api.html">
|
||
|
||
<a href="api.html">
|
||
|
||
|
||
管理API
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.9" data-path="QA.html">
|
||
|
||
<a href="QA.html">
|
||
|
||
|
||
问题汇总
|
||
|
||
</a>
|
||
|
||
|
||
|
||
<ul class="articles">
|
||
|
||
|
||
<li class="chapter " data-level="1.9.1" data-path="QA.html">
|
||
|
||
<a href="QA.html">
|
||
|
||
|
||
常见问题
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.9.2" data-path="QA.html">
|
||
|
||
<a href="QA.html">
|
||
|
||
|
||
维护问题
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class="chapter " data-level="1.10" data-path="upgrade.html">
|
||
|
||
<a href="upgrade.html">
|
||
|
||
|
||
更新历史
|
||
|
||
</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
|
||
|
||
|
||
<li class="divider"></li>
|
||
|
||
<li>
|
||
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
|
||
Published with GitBook
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
|
||
|
||
</nav>
|
||
|
||
|
||
</div>
|
||
|
||
<div class="book-body">
|
||
|
||
<div class="body-inner">
|
||
|
||
|
||
|
||
<div class="book-header" role="navigation">
|
||
|
||
|
||
<!-- Title -->
|
||
<h1>
|
||
<i class="fa fa-circle-o-notch fa-spin"></i>
|
||
<a href="." >管理API</a>
|
||
</h1>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<div class="page-wrapper" tabindex="-1" role="main">
|
||
<div class="page-inner">
|
||
|
||
<div id="book-search-results">
|
||
<div class="search-noresults">
|
||
|
||
<section class="normal markdown-section">
|
||
|
||
<h2 id="api通用说明">API通用说明</h2>
|
||
<pre><code>一、统一使用POST请求
|
||
二、返回格式统一为json
|
||
  格式如下
|
||
{
|
||
"status":"ok",
|
||
"message":"",
|
||
"data":{}
|
||
}
|
||
二、url中的group只有在support_group_manage设置为true才有。
|
||
例如:
|
||
http://10.1.5.9:8080/group/reload
|
||
默认:
|
||
http://10.1.5.9:8080/reload
|
||
说明:url中的group为cfg.json中的group参数值。
|
||
</code></pre><h2 id="配置管理api">配置管理API</h2>
|
||
<pre><code>http://10.1.5.9:8080/group/reload
|
||
|
||
参数:
|
||
action: set(修改参数),get获取参数,reload重新加载参数
|
||
cfg:json参数 与 action=set配合完成参数设置
|
||
</code></pre><h2 id="文件统计信息api">文件统计信息API</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/stat
|
||
</code></pre><h2 id="文件上传api">文件上传API</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/upload
|
||
参数:
|
||
file:上传的文件
|
||
scene:场景
|
||
output:输出
|
||
path:自定义路径
|
||
具体请参阅示例代码(用浏览器访问http://127.0.0.1:8080)
|
||
</code></pre><h2 id="文件秒传">文件秒传</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/upload
|
||
参数:
|
||
md5:文件的摘要
|
||
摘要算法要与cfg.json中配置的一样
|
||
例子:http://127.0.0.1:8080/upload?md5=430a71f5c5e093a105452819cc48cc9c&output=json
|
||
</code></pre><h2 id="文件删除">文件删除</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/delete
|
||
参数:
|
||
md5:文件的摘要(md5|sha1) 视配置定
|
||
path:文件路径
|
||
md5与path二选一
|
||
说明:md5或path都是上传文件时返回的信息,要以json方式返回才能看到(参阅浏览器上传)
|
||
http://127.0.0.1:8080/delete?md5=430a71f5c5e093a105452819cc48cc9c
|
||
</code></pre><h2 id="文件信息">文件信息</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/get_file_info
|
||
参数:
|
||
md5:文件的摘要(md5|sha1) 视配置定
|
||
path:文件路径
|
||
md5与path二选一
|
||
说明:md5或path都是上传文件时返回的信息,要以json方式返回才能看到(参阅浏览器上传)
|
||
例子:http://127.0.0.1:8080/get_file_info?md5=430a71f5c5e093a105452819cc48cc9c
|
||
</code></pre><h2 id="文件列表">文件列表</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/list_dir
|
||
参数:
|
||
dir:要查看文件列表的目录名
|
||
例子:http://127.0.0.1:8080/list_dir?dir=default
|
||
</code></pre><h2 id="修复统计信息">修复统计信息</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/repair_stat
|
||
参数:
|
||
date:要修复的日期,格式如:20190725
|
||
例子:http://127.0.0.1:8080/repair_stat?date=20190725
|
||
</code></pre><h2 id="同步失败修复">同步失败修复</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/repair
|
||
参数:
|
||
force:是否强行修复(0|1)
|
||
例子:http://127.0.0.1:8080/repair?force=1
|
||
</code></pre><h2 id="从文件目录中修复元数据(性能较差)">从文件目录中修复元数据(性能较差)</h2>
|
||
<pre><code>http://10.1.50.90:8080/group/repair_fileinfo
|
||
需要开启搬迁功能,修改cfg.json配置文件中的 enable_migrate 设为true
|
||
</code></pre>
|
||
|
||
</section>
|
||
|
||
</div>
|
||
<div class="search-results">
|
||
<div class="has-results">
|
||
|
||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||
<ul class="search-results-list"></ul>
|
||
|
||
</div>
|
||
<div class="no-results">
|
||
|
||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<a href="breakpoint.html#js" class="navigation navigation-prev " aria-label="Previous page: Javascript">
|
||
<i class="fa fa-angle-left"></i>
|
||
</a>
|
||
|
||
|
||
<a href="QA.html" class="navigation navigation-next " aria-label="Next page: 问题汇总">
|
||
<i class="fa fa-angle-right"></i>
|
||
</a>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var gitbook = gitbook || [];
|
||
gitbook.push(function() {
|
||
gitbook.page.hasChanged({"page":{"title":"管理API","level":"1.8","depth":1,"next":{"title":"问题汇总","level":"1.9","depth":1,"path":"QA.md","ref":"QA.md","articles":[{"title":"常见问题","level":"1.9.1","depth":2,"path":"QA.md","ref":"QA.md","articles":[]},{"title":"维护问题","level":"1.9.2","depth":2,"path":"QA.md","ref":"QA.md","articles":[]}]},"previous":{"title":"Javascript","level":"1.7.2","depth":2,"anchor":"#js","path":"breakpoint.md","ref":"breakpoint.md#js","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"api.md","mtime":"2021-11-06T03:20:41.218Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-11-06T08:18:31.357Z"},"basePath":".","book":{"language":""}});
|
||
});
|
||
</script>
|
||
</div>
|
||
|
||
|
||
<script src="gitbook/gitbook.js"></script>
|
||
<script src="gitbook/theme.js"></script>
|
||
|
||
|
||
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
|
||
|
||
|
||
|
||
<script src="gitbook/gitbook-plugin-search/search.js"></script>
|
||
|
||
|
||
|
||
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
|
||
|
||
|
||
|
||
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
|
||
|
||
|
||
|
||
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
|
||
|
||
|
||
|
||
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
|
||
|
||
|
||
|
||
</body>
|
||
</html>
|
||
|