From e6bfa3e33bcde4e2288c512b17c5f33c796f88b7 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Mon, 30 Nov 2020 19:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E4=BB=A4agHttpCli=20to=20AgV?= =?UTF-8?q?stCli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +- src/agApi/agAdminMonitor.erl | 32 +++---- src/agApi/agAnalyzers.erl | 10 +-- src/agApi/agAqls.erl | 40 ++++----- src/agApi/agAsyncResultHandling.erl | 14 +-- src/agApi/agBulkImportExport.erl | 6 +- src/agApi/agCluster.erl | 10 +-- src/agApi/agCollections.erl | 56 ++++++------ src/agApi/agDbMgr.erl | 10 +-- src/agApi/agDocuments.erl | 50 +++++------ src/agApi/agEdges.erl | 2 +- src/agApi/agEndPoints.erl | 2 +- src/agApi/agFoxxServices.erl | 44 +++++----- src/agApi/agGeneralGraphs.erl | 88 +++++++++---------- src/agApi/agHotBackup.erl | 12 +-- src/agApi/agIndexes.erl | 32 +++---- src/agApi/agMiscFuns.erl | 28 +++--- src/agApi/agRepairJobs.erl | 4 +- src/agApi/agReplication.erl | 60 ++++++------- src/agApi/agTasks.erl | 10 +-- src/agApi/agTransactions.erl | 12 +-- src/agApi/agUserMgr.erl | 28 +++--- src/agApi/agViews.erl | 16 ++-- .../agAgencyPoolMgrExm.erl | 0 .../agAgencyPoolMgrIns.erl | 0 .../agAgencyPool_sup.erl | 0 src/{agHttpCli => agVstCli}/agAgencyUtils.erl | 0 .../agHttpProtocol.erl | 0 src/{agHttpCli => agVstCli}/agKvsToBeam.erl | 0 src/{agHttpCli => agVstCli}/agMiscUtils.erl | 0 .../agSslAgencyExm.erl | 0 .../agSslAgencyIns.erl | 0 .../agTcpAgencyExm.erl | 0 .../agTcpAgencyIns.erl | 0 .../agVstAgencyExm.erl | 0 .../agVstAgencyIns.erl | 0 .../agHttpCli.erl => agVstCli/agVstCli.erl} | 2 +- src/{agHttpCli => agVstCli}/vst.erl | 0 src/user_default.erl | 4 +- 39 files changed, 290 insertions(+), 290 deletions(-) rename src/{agHttpCli => agVstCli}/agAgencyPoolMgrExm.erl (100%) rename src/{agHttpCli => agVstCli}/agAgencyPoolMgrIns.erl (100%) rename src/{agHttpCli => agVstCli}/agAgencyPool_sup.erl (100%) rename src/{agHttpCli => agVstCli}/agAgencyUtils.erl (100%) rename src/{agHttpCli => agVstCli}/agHttpProtocol.erl (100%) rename src/{agHttpCli => agVstCli}/agKvsToBeam.erl (100%) rename src/{agHttpCli => agVstCli}/agMiscUtils.erl (100%) rename src/{agHttpCli => agVstCli}/agSslAgencyExm.erl (100%) rename src/{agHttpCli => agVstCli}/agSslAgencyIns.erl (100%) rename src/{agHttpCli => agVstCli}/agTcpAgencyExm.erl (100%) rename src/{agHttpCli => agVstCli}/agTcpAgencyIns.erl (100%) rename src/{agHttpCli => agVstCli}/agVstAgencyExm.erl (100%) rename src/{agHttpCli => agVstCli}/agVstAgencyIns.erl (100%) rename src/{agHttpCli/agHttpCli.erl => agVstCli/agVstCli.erl} (99%) rename src/{agHttpCli => agVstCli}/vst.erl (100%) diff --git a/README.md b/README.md index 01bc622..cc33457 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ # Feature Efficient, fast and easy to use. - 1. To make this driver as efficient as possible, customizations encapsulate an HTTP1.1 client(agHttpCli) with connection pooling. - Comparisons between packaged agHttpCli and similar HTTP client tests are available:[Address](https://github.com/SisMaker/httpc_bench) + 1. To make this driver as efficient as possible, customizations encapsulate an HTTP1.1 client(agVstCli) with connection pooling. + Comparisons between packaged agVstCli and similar HTTP client tests are available:[Address](https://github.com/SisMaker/httpc_bench) 2. This driver can use connection pooling or simply establish multiple connections in a single process (non-connection pooling mode) for various data operations. Synchronous and asynchronous operations are supported when using connection pooling, and you need to save the requestId extra if you want to use asynchronous operations Waiting for the received data to return, @@ -28,13 +28,13 @@ revar3: rebar3 shell Non-connection pooling mode Make a connection first - {ok, Socket} = agHttpCli:connect([]). %% Use default Settings + {ok, Socket} = agVstCli:connect([]). %% Use default Settings %% Then you can then call various apis using Socket as the first argument agMgrDb:curDbInfo(Socket). Connection pooling mode application:ensure_all_started(erlArango). %% start app - agHttpCli:startPool(poolName, [], []). %% start pool + agVstCli:startPool(poolName, [], []). %% start pool %% Then you can then invoke various apis using poolName as the first argument agMgrDb:curDbInfo(poolName). diff --git a/src/agApi/agAdminMonitor.erl b/src/agApi/agAdminMonitor.erl index a9ae91c..72f4c2e 100644 --- a/src/agApi/agAdminMonitor.erl +++ b/src/agApi/agAdminMonitor.erl @@ -34,12 +34,12 @@ % 400:如果为up或level指定了无效值,则返回。 % 500:如果服务器由于内存不足错误而无法生成结果,则返回。 getAdminLog(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/log">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/log">>, [], undefined). getAdminLog(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_admin/log", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回当前的日志级别设置 % GET /_admin/log/level @@ -48,7 +48,7 @@ getAdminLog(PoolNameOrSocket, QueryPars) -> % 200:如果请求有效,则返回 % 500:如果服务器由于内存不足错误而无法生成结果,则返回。 getAdminLogLevel(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/log/level">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/log/level">>, [], undefined). % 修改当前的日志级别设置 % PUT /_admin/log/level @@ -110,7 +110,7 @@ getAdminLogLevel(PoolNameOrSocket) -> % 500:如果服务器由于内存不足错误而无法生成结果,则返回。 modifyAdminLogLevel(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/log/level">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/log/level">>, [], BodyStr). % 返回统计信息 % GET /_admin/statistics @@ -180,7 +180,7 @@ modifyAdminLogLevel(PoolNameOrSocket, MapData) -> % 进行中:当前繁忙的工作线程数 % 排队:排队等待工作线程可用的作业数 getAdminProps(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/statistics">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/statistics">>, [], undefined). % 统计数据说明 % 获取统计信息的描述性信息 @@ -214,7 +214,7 @@ getAdminProps(PoolNameOrSocket) -> % code:HTTP状态码 % 错误:错误,在这种情况下为false getAdminStatisticsDesc(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/statistics-description">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/statistics-description">>, [], undefined). % TLS 永久链接 % 返回TLS数据的摘要 @@ -233,7 +233,7 @@ getAdminStatisticsDesc(PoolNameOrSocket) -> % 返回码 % 200:如果一切正常,此API将返回HTTP 200 getAdminTLS(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/tls">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/tls">>, [], undefined). % 触发TLS数据的重新加载并返回摘要永久链接 % 触发此服务器的TLS数据(服务器密钥,客户端身份验证CA)的重新加载,并以摘要形式返回新数据。 @@ -244,7 +244,7 @@ getAdminTLS(PoolNameOrSocket) -> % 200:如果一切正常,此API将返回HTTP 200 % 403:如果未使用超级用户权限调用此API,它将返回HTTP 403 FORBIDDEN。 triggerAdminTLS(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/server/tls">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/server/tls">>, [], undefined). % 返回当前实例指标 % GET /_admin/metrics @@ -255,7 +255,7 @@ triggerAdminTLS(PoolNameOrSocket) -> % 200:指标已成功返回。 % 404:可以使用--server.export-metrics-api false 服务器中的设置禁用指标API 。在这种情况下,调用结果表明找不到该API。 getAdminMetrics(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/metrics">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/metrics">>, [], undefined). % 集群 @@ -267,7 +267,7 @@ getAdminMetrics(PoolNameOrSocket) -> % 返回码 % 200:如果一切正常,此API将返回HTTP 200 getAdminServerMode(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/mode">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/mode">>, [], undefined). % 返回集群永久链接中服务器的ID % 了解服务器的内部ID @@ -277,7 +277,7 @@ getAdminServerMode(PoolNameOrSocket) -> % 200:当服务器以群集模式运行时返回。 % 500:当服务器未在群集模式下运行时返回。 getAdminServerId(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/id">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/id">>, [], undefined). % 返回集群中服务器的角色 % GET /_admin/server/role @@ -294,7 +294,7 @@ getAdminServerId(PoolNameOrSocket) -> % errorNum:服务器错误号 % 作用:之一[ SINGLE,协调员,PRIMARY,SECONDARY,AGENT,UNDEFINED ] getAdminServerRole(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/role">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/role">>, [], undefined). % 返回服务器是否可用 @@ -305,7 +305,7 @@ getAdminServerRole(PoolNameOrSocket) -> % 200:如果服务器已启动并且正在运行并且可用于任意操作,并且未设置为只读模式,并且在活动故障转移设置的情况下当前不是关注者,则此API将返回HTTP 200。 % 503:如果服务器在启动或关闭过程中,设置为只读模式或当前在活动故障转移设置中为关注者,则将返回HTTP 503。 getAdminServerAvailability(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/availability">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/availability">>, [], undefined). % DBserver 永久链接的查询统计信息 % 允许查询集群中数据库服务器的统计信息 @@ -318,7 +318,7 @@ getAdminServerAvailability(PoolNameOrSocket) -> % 403: getAdminClusterProps(PoolNameOrSocket, DBserver) -> Path = <<"/_admin/clusterStatistics?DBserver=", (agMiscUtils:toBinary(DBserver))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 查询集群的运行状况以监视Permalink % 返回由监督(机构)评估的集群的运行状况 @@ -349,7 +349,7 @@ getAdminClusterProps(PoolNameOrSocket, DBserver) -> % 返回码 % 200: getAdminClusterHealth(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/cluster/health">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/cluster/health">>, [], undefined). % 重新加载路由表。 % POST /_admin/routing/reload @@ -357,4 +357,4 @@ getAdminClusterHealth(PoolNameOrSocket) -> % 返回码 % 200:路由信息重新加载成功 reloadAdminRouting(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/routing/reload">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/routing/reload">>, [], undefined). diff --git a/src/agApi/agAnalyzers.erl b/src/agApi/agAnalyzers.erl index e33dff6..4f5b1d8 100644 --- a/src/agApi/agAnalyzers.erl +++ b/src/agApi/agAnalyzers.erl @@ -26,7 +26,7 @@ % 403:用户无权使用此配置创建和分析器。 newAnalyzer(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/analyzer">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/analyzer">>, [], BodyStr). % 返回分析器定义 % GET /_api/analyzer/{analyzer-name} @@ -42,7 +42,7 @@ newAnalyzer(PoolNameOrSocket, MapData) -> % 404:不存在这种分析器配置。 getAnalyzer(PoolNameOrSocket, AnalyzerName) -> Path = <<"/_api/analyzer/", AnalyzerName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回可用的分析器定义列表 % GET /_api/analyzer @@ -54,7 +54,7 @@ getAnalyzer(PoolNameOrSocket, AnalyzerName) -> % 返回码 % 200:分析器定义已成功检索。 getAnalyzerList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/analyzer">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/analyzer">>, [], undefined). % 删除分析仪配置 % DELETE /_api/analyzer/{analyzer-name} @@ -74,9 +74,9 @@ getAnalyzerList(PoolNameOrSocket) -> % 409:指定的分析器配置仍在使用中,并且省略了强制或 指定了错误。。 delAnalyzer(PoolNameOrSocket, AnalyzerName) -> Path = <<"/_api/analyzer/", AnalyzerName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delAnalyzer(PoolNameOrSocket, AnalyzerName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/analyzer/", AnalyzerName/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). diff --git a/src/agApi/agAqls.erl b/src/agApi/agAqls.erl index 9ec2ca2..8562691 100644 --- a/src/agApi/agAqls.erl +++ b/src/agApi/agAqls.erl @@ -86,7 +86,7 @@ % 405:如果使用了不受支持的HTTP方法,则服务器将以HTTP 405进行响应。 newCursor(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/cursor">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/cursor">>, [], BodyStr). % 从现有游标返回下一个结果 @@ -105,7 +105,7 @@ newCursor(PoolNameOrSocket, MapData) -> % 404:如果找不到具有指定标识符的游标,则服务器将使用HTTP 404进行响应。 nextCursor(PoolNameOrSocket, CursorId) -> Path = <<"/_api/cursor/", (agMiscUtils:toBinary(CursorId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 删除光标永 % DELETE /_api/cursor/{cursor-identifier} @@ -119,7 +119,7 @@ nextCursor(PoolNameOrSocket, CursorId) -> % 404:如果服务器不知道游标,则返回404。如果在销毁游标后使用了游标,也将返回该值。 delCursor(PoolNameOrSocket, CursorId) -> Path = <<"/_api/cursor/", (agMiscUtils:toBinary(CursorId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % AQL查询的HTTP接口 % @@ -155,7 +155,7 @@ delCursor(PoolNameOrSocket, CursorId) -> % 404:如果查询中访问了不存在的集合,服务器将以HTTP 404进行响应。 explainQuery(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/explain">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/explain">>, [], BodyStr). % 解析一个AQL查询并返回有关它的信息 % POST /_api/query @@ -167,7 +167,7 @@ explainQuery(PoolNameOrSocket, MapData) -> % 400:如果请求格式错误或查询包含解析错误,服务器将以HTTP 400响应。响应的正文将包含嵌入在JSON对象中的错误详细信息。 parseQuery(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/query">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/query">>, [], BodyStr). % 查询跟踪固定链接 % ArangoDB具有HTTP接口,用于检索当前正在执行的AQL查询列表和慢速AQL查询列表。为了有意义地使用这些API,需要在执行HTTP请求的数据库中启用查询跟踪。 @@ -185,7 +185,7 @@ parseQuery(PoolNameOrSocket, MapData) -> % 200:如果成功检索到属性,则返回。 % 400:如果请求格式错误,服务器将以HTTP 400进行响应, getQueryProps(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query/properties">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query/properties">>, [], undefined). % 更改AQL查询跟踪的配置 % PUT /_api/query/properties @@ -203,7 +203,7 @@ getQueryProps(PoolNameOrSocket) -> % 400:如果请求格式错误,服务器将以HTTP 400进行响应, changeQueryProps(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/query/properties">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/query/properties">>, [], BodyStr). % 返回当前正在运行的AQL查询的列表 % GET /_api/query/current @@ -219,7 +219,7 @@ changeQueryProps(PoolNameOrSocket, MapData) -> % 200:可以成功检索查询列表时返回。 % 400:如果请求格式错误,服务器将以HTTP 400进行响应, currentQuery(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query/current">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query/current">>, [], undefined). % 返回运行缓慢的AQL查询的列表 @@ -237,7 +237,7 @@ currentQuery(PoolNameOrSocket) -> % 200:可以成功检索查询列表时返回。 % 400:如果请求格式错误,服务器将以HTTP 400进行响应, getSlowQuery(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query/slow">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query/slow">>, [], undefined). % 清除慢速AQL查询列表 % DELETE /_api/query/slow @@ -246,7 +246,7 @@ getSlowQuery(PoolNameOrSocket) -> % 200:成功清除查询列表后,服务器将以HTTP 200响应。 % 400:如果请求格式错误,服务器将使用HTTP 400进行响应。 delSlowQuery(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, <<"/_api/query/slow">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, <<"/_api/query/slow">>, [], undefined). % 杀死查询永久链接 @@ -263,7 +263,7 @@ delSlowQuery(PoolNameOrSocket) -> % 404:当找不到指定ID的查询时,服务器将以HTTP 404响应。 killQuery(PoolNameOrSocket, QueryId) -> Path = <<"/_api/query/", (agMiscUtils:toBinary(QueryId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % AQL查询结果缓存的HTTP接口 % 本节介绍用于控制AQL查询结果缓存的API方法。 @@ -284,7 +284,7 @@ killQuery(PoolNameOrSocket, QueryId) -> % 200:可以成功检索结果列表时返回。 % 400:如果请求格式错误,服务器将以HTTP 400进行响应, getQueryCaches(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query-cache/entries">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query-cache/entries">>, [], undefined). % 清除AQL查询结果缓存中的所有结果 % DELETE /_api/query-cache @@ -293,7 +293,7 @@ getQueryCaches(PoolNameOrSocket) -> % 200:成功清除缓存后,服务器将以HTTP 200响应。 % 400:如果请求格式错误,服务器将使用HTTP 400进行响应。 clearQueryCaches(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, <<"/_api/query-cache">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, <<"/_api/query-cache">>, [], undefined). % 返回AQL查询结果缓存的全局配置 % GET /_api/query-cache/properties @@ -307,7 +307,7 @@ clearQueryCaches(PoolNameOrSocket) -> % 200:如果可以成功检索属性,则返回。 % 400:如果请求格式错误,服务器将以HTTP 400进行响应, getQCacheProps(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query-cache/properties">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/query-cache/properties">>, [], undefined). % 全局调整AQL查询结果缓存属性 % PUT /_api/query-cache/properties @@ -324,7 +324,7 @@ getQCacheProps(PoolNameOrSocket) -> % 400:如果请求格式错误,服务器将以HTTP 400进行响应, changeQCacheProps(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/query-cache/properties">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/query-cache/properties">>, [], BodyStr). % AQL用户功能管理固定链接 % 这是用于管理AQL用户功能的ArangoDB HTTP接口的简介。AQL用户功能是一种使用用户定义的JavaScript代码扩展ArangoDB查询语言(AQL)功能的方法。 @@ -354,7 +354,7 @@ changeQCacheProps(PoolNameOrSocket, MapData) -> % errorMessage:描述性错误消息 newUserFun(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/aqlfunction">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/aqlfunction">>, [], BodyStr). % 删除现有的AQL用户功能 % DELETE /_api/aqlfunction/{name} @@ -381,12 +381,12 @@ newUserFun(PoolNameOrSocket, MapData) -> % errorMessage:描述性错误消息 delUserFun(PoolNameOrSocket, UserFunName) -> Path = <<"/_api/aqlfunction/", (agMiscUtils:toBinary(UserFunName))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delUserFun(PoolNameOrSocket, UserFunName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/aqlfunction/", (agMiscUtils:toBinary(UserFunName))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 返回注册的AQL用户功能 % GET /_api/aqlfunction @@ -407,12 +407,12 @@ delUserFun(PoolNameOrSocket, UserFunName, QueryPars) -> % errorNum:服务器错误号 % errorMessage:描述性错误消息 getUserFuns(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/aqlfunction">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/aqlfunction">>, [], undefined). getUserFuns(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/aqlfunction", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). diff --git a/src/agApi/agAsyncResultHandling.erl b/src/agApi/agAsyncResultHandling.erl index 2c5bc19..27c19cd 100644 --- a/src/agApi/agAsyncResultHandling.erl +++ b/src/agApi/agAsyncResultHandling.erl @@ -68,7 +68,7 @@ % 404:如果找不到或已经从作业结果列表中删除或提取了作业,则返回404。在这种情况下,不会返回x-arango-async-id HTTP标头。 getAsyncJobRet(PoolNameOrSocket, JodId) -> Path = <<"/_api/job/", (agMiscUtils:toBinary(JodId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 取消异步作业 @@ -82,7 +82,7 @@ getAsyncJobRet(PoolNameOrSocket, JodId) -> % 404:如果找不到或已经从作业结果列表中删除或提取了作业,则返回404。在这种情况下,不会返回x-arango-async-id HTTP标头。 cancelAsyncJob(PoolNameOrSocket, JodId) -> Path = <<"/_api/job/", (agMiscUtils:toBinary(JodId))/binary, "/cancel">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 删除异步作业结果 % DELETE /_api/job/{type}#by-type @@ -100,12 +100,12 @@ cancelAsyncJob(PoolNameOrSocket, JodId) -> % 404:如果type为job-id,但未找到具有指定id的异步作业,则返回404。 delAsyncJobRet(PoolNameOrSocket, TypeOrJodId) -> Path = <<"/_api/job/", (agMiscUtils:toBinary(TypeOrJodId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delAsyncJobRet(PoolNameOrSocket, TypeOrJodId, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/job/", (agMiscUtils:toBinary(TypeOrJodId))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 返回特定作业的状态 % GET /_api/job/{job-id} @@ -118,7 +118,7 @@ delAsyncJobRet(PoolNameOrSocket, TypeOrJodId, QueryPars) -> % 404:如果找不到或已经从作业结果列表中删除或提取了作业,则返回404。 getAsyncJobStatus(PoolNameOrSocket, JodId) -> Path = <<"/_api/job/", (agMiscUtils:toBinary(JodId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回具有特定状态的工作结果ID % GET /_api/job/{type}#by-type @@ -132,9 +132,9 @@ getAsyncJobStatus(PoolNameOrSocket, JodId) -> % 400:如果未指定type或值无效,则返回。 getAsyncJobList(PoolNameOrSocket, Type) -> Path = <<"/_api/job/", (agMiscUtils:toBinary(Type))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getAsyncJobList(PoolNameOrSocket, Type, Count) -> Path = <<"/_api/job/", (agMiscUtils:toBinary(Type))/binary, "?count=", (agMiscUtils:toBinary(Count))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). diff --git a/src/agApi/agBulkImportExport.erl b/src/agApi/agBulkImportExport.erl index a669ab7..7a3aa5a 100644 --- a/src/agApi/agBulkImportExport.erl +++ b/src/agApi/agBulkImportExport.erl @@ -59,7 +59,7 @@ docImport(PoolNameOrSocket, ListOfList, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/import", QueryBinary/binary>>, BodyStr = <<<<(jiffy:encode(OneList))/binary, "\n">> || OneList <- ListOfList>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 从JSON导入文档 % POST /_api/import#json @@ -109,7 +109,7 @@ jsonImport(PoolNameOrSocket, MapDataList, QueryPars) -> end, QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/import", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 说明-------> % 导入自包含的JSON文档 @@ -230,4 +230,4 @@ jsonImport(PoolNameOrSocket, MapDataList, QueryPars) -> docExport(PoolNameOrSocket, CollName, MapData) -> Path = <<"/_api/export?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). \ No newline at end of file + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). \ No newline at end of file diff --git a/src/agApi/agCluster.erl b/src/agApi/agCluster.erl index 0baaad8..7add39a 100644 --- a/src/agApi/agCluster.erl +++ b/src/agApi/agCluster.erl @@ -25,7 +25,7 @@ % 200:当服务器以群集模式运行时返回。 % 500:当服务器未在群集模式下运行时返回。 serverId(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/id">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/id">>, [], undefined). % 返回集群中服务器的角色 % GET /_admin/server/role @@ -42,7 +42,7 @@ serverId(PoolNameOrSocket) -> % errorNum:服务器错误号 % role:之一[ SINGLE,COORDINATOR,PRIMARY,SECONDARY,AGENT,UNDEFINED ] serverRole(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/role">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/role">>, [], undefined). % 数据库服务器的查询统计信息 % 允许查询集群中DB-Server的统计信息 @@ -55,7 +55,7 @@ serverRole(PoolNameOrSocket) -> % 403: clusterStats(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/clusterStatistics", QueryBinary/binary>>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/clusterStatistics", QueryBinary/binary>>, [], undefined). % 返回监督(机构)评估的集群的运行状况 % GET /_admin/cluster/health @@ -85,7 +85,7 @@ clusterStats(PoolNameOrSocket, QueryPars) -> % 返回码 % 200: clusterHealth(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/cluster/health">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/cluster/health">>, [], undefined). % 启用或禁用集群监督(代理)维护模式 % PUT /_admin/cluster/maintenance @@ -97,7 +97,7 @@ clusterHealth(PoolNameOrSocket) -> % 501: % 504: setClusterMaintenance(PoolNameOrSocket, OnOrOff) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/cluster/maintenance">>, [], OnOrOff). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/cluster/maintenance">>, [], OnOrOff). %%%%%%%%%%%%%%% Agency ?????????????????????????? diff --git a/src/agApi/agCollections.erl b/src/agApi/agCollections.erl index affa46e..b4d03c0 100644 --- a/src/agApi/agCollections.erl +++ b/src/agApi/agCollections.erl @@ -93,13 +93,13 @@ newColl(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/collection">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/collection">>, [], BodyStr). newColl(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/collection", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 删除收藏 % DELETE /_api/collection/{collection-name} @@ -117,16 +117,16 @@ newColl(PoolNameOrSocket, MapData, QueryPars) -> % 404:如果集合名称未知,则返回HTTP 404。 delColl(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delColl(PoolNameOrSocket, CollName, IsSystem) -> case IsSystem of true -> Path = <<"/_api/collection/", CollName/binary, "?isSystem=true">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined); + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined); _ -> Path = <<"/_api/collection/", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined) + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined) end. % 清除集合 @@ -140,7 +140,7 @@ delColl(PoolNameOrSocket, CollName, IsSystem) -> % 404:如果集合名称未知,则 返回HTTP 404。 clearColl(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/truncate">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 返回有关集合的信息 % GET /_api/collection/{collection-name} @@ -166,7 +166,7 @@ clearColl(PoolNameOrSocket, CollName) -> % 404:如果集合名称未知,则返回HTTP 404。 collInfo(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 读取指定集合的属性 @@ -179,7 +179,7 @@ collInfo(PoolNameOrSocket, CollName) -> % HTTP 200 collProps(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", (CollName)/binary, "/properties">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 计算集合中的文档数量 % GET /_api/collection/{collection-name}/count @@ -193,7 +193,7 @@ collProps(PoolNameOrSocket, CollName) -> % 404:如果集合名称未知,则 返回HTTP 404。 collCount(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/count">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 获取集合的统计信息 % GET /_api/collection/{collection-name}/figures @@ -211,7 +211,7 @@ collCount(PoolNameOrSocket, CollName) -> % 404:如果集合名称未知,则 返回HTTP 404。 collFigures(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/figures">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回负责文档的分片 % PUT /_api/collection/{collection-name}/responsibleShard @@ -232,7 +232,7 @@ collFigures(PoolNameOrSocket, CollName) -> collResponsibleShard(PoolNameOrSocket, CollName, MapData) -> Path = <<"/_api/collection/", CollName/binary, "/responsibleShard">>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], BodyStr). % 返回集合的分片ID % GET /_api/collection/{collection-name}/shards @@ -250,16 +250,16 @@ collResponsibleShard(PoolNameOrSocket, CollName, MapData) -> % 501:如果在单个服务器上调用该方法,则返回HTTP 501。 collShards(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/shards">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). collShards(PoolNameOrSocket, CollName, IsDetails) -> case IsDetails of true -> Path = <<"/_api/collection/", CollName/binary, "/shards?details=true">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined); + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined); _ -> Path = <<"/_api/collection/", CollName/binary, "/shards">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined) + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined) end. % 返回集合修订版ID @@ -274,7 +274,7 @@ collShards(PoolNameOrSocket, CollName, IsDetails) -> % 404:如果集合名称未知,则 返回HTTP 404。 collRev(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/revision">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回指定集合的校验和 % GET /_api/collection/{collection-name}/checksum @@ -298,12 +298,12 @@ collRev(PoolNameOrSocket, CollName) -> % 404:如果集合名称未知,则 返回HTTP 404。 collChecksum(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/checksum">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). collChecksum(PoolNameOrSocket, CollName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/collection/", CollName/binary, "/checksum", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回所有集合列表 % GET /_api/collection @@ -315,15 +315,15 @@ collChecksum(PoolNameOrSocket, CollName, QueryPars) -> % 返回码 % 200:收藏列表 collList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, [], undefined). collList(PoolNameOrSocket, IsExcludeSystem) -> case IsExcludeSystem of false -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, [], undefined); + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, [], undefined); _ -> Path = <<"/_api/collection?excludeSystem=true">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined) + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined) end. % 加载集合 @@ -348,11 +348,11 @@ collList(PoolNameOrSocket, IsExcludeSystem) -> % 404:如果集合名称未知,则 返回HTTP 404。 loadColl(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/load">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). loadColl(PoolNameOrSocket, CollName, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/collection/", CollName/binary, "/load">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/collection/", CollName/binary, "/load">>, [], BodyStr). % 卸载集合 % PUT /_api/collection/{collection-name}/unload @@ -371,7 +371,7 @@ loadColl(PoolNameOrSocket, CollName, MapData) -> % 404:如果集合名称未知,则返回HTTP 404。 unloadColl(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/unload">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 将索引加载到内存中 % PUT /_api/collection/{collection-name}/loadIndexesIntoMemory @@ -387,7 +387,7 @@ unloadColl(PoolNameOrSocket, CollName) -> % 404:如果集合名称未知,则返回HTTP 404。 collLoadIndexesIntoMemory(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/loadIndexesIntoMemory">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 更改集合的属性 % PUT /_api/collection/{collection-name}/properties @@ -422,7 +422,7 @@ collLoadIndexesIntoMemory(PoolNameOrSocket, CollName) -> collChangeProps(PoolNameOrSocket, CollName, MapData) -> Path = <<"/_api/collection/", CollName/binary, "/properties">>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 重命名集合 % PUT /_api/collection/{collection-name}/rename @@ -447,7 +447,7 @@ collChangeProps(PoolNameOrSocket, CollName, MapData) -> renameColl(PoolNameOrSocket, OldName, NewName) -> Path = <<"/_api/collection/", OldName/binary, "/rename">>, NameStr = jiffy:encode(NewName), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], <<"{\"name\":", NameStr/binary, "}">>). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], <<"{\"name\":", NameStr/binary, "}">>). % 旋转收藏夹的日记 % PUT /_api/collection/{collection-name}/rotate @@ -464,7 +464,7 @@ renameColl(PoolNameOrSocket, OldName, NewName) -> % 3.7中删掉了该方法 collRotate(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/rotate">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 重新计算集合的文档数 % PUT /_api/collection/{collection-name}/recalculateCount @@ -479,4 +479,4 @@ collRotate(PoolNameOrSocket, CollName) -> % 404:如果集合名称未知,则返回HTTP 404。 collRecount(PoolNameOrSocket, CollName) -> Path = <<"/_api/collection/", CollName/binary, "/recalculateCount">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). \ No newline at end of file + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). \ No newline at end of file diff --git a/src/agApi/agDbMgr.erl b/src/agApi/agDbMgr.erl index 0a1ed43..90c3e41 100644 --- a/src/agApi/agDbMgr.erl +++ b/src/agApi/agDbMgr.erl @@ -34,7 +34,7 @@ % 400:如果请求无效,则返回。 % 404:如果找不到数据库,则返回。 curDbInfo(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/current">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/current">>, [], undefined). % 检索当前用户可以访问的所有数据库的列表 % GET /_api/database/user @@ -43,7 +43,7 @@ curDbInfo(PoolNameOrSocket) -> % 200:如果数据库列表编译成功,则返回。 % 400:如果请求无效,则返回。 visitDbs(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/user">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/user">>, [], undefined). % 检索所有现有数据库的列表 % GET /_api/database @@ -55,7 +55,7 @@ visitDbs(PoolNameOrSocket) -> % 400:如果请求无效,则返回。 % 403:如果请求未在_system数据库中执行,则返回。 allDbs(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database">>, [], undefined, true). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database">>, [], undefined, true). % 创建一个新的数据库 % POST /_api/database @@ -80,7 +80,7 @@ allDbs(PoolNameOrSocket) -> % 409:如果具有指定名称的数据库已经存在,则返回。 newDb(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/database">>, [], BodyStr, true). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/database">>, [], BodyStr, true). % 删除现有数据库 % DELETE /_api/database/{database-name} @@ -95,4 +95,4 @@ newDb(PoolNameOrSocket, MapData) -> % 404:如果找不到数据库,则返回。 delDb(PoolNameOrSocket, Name) -> Path = <<"/_api/database/", Name/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined, true). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined, true). diff --git a/src/agApi/agDocuments.erl b/src/agApi/agDocuments.erl index 1367d12..9e4411a 100644 --- a/src/agApi/agDocuments.erl +++ b/src/agApi/agDocuments.erl @@ -102,11 +102,11 @@ % 412:如果给出“ If-Match”标头并且找到的文档具有不同版本,则返回412。响应还将在_rev属性中包含找到的文档的当前修订。此外,将返回属性_id和_key。 getDoc(PoolNameOrSocket, CollName, Key) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getDoc(PoolNameOrSocket, CollName, Key, Headers) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined). % 读取单个文档头 % HEAD /_api/document/{collection}/{key} @@ -124,11 +124,11 @@ getDoc(PoolNameOrSocket, CollName, Key, Headers) -> % 412:如果给出“ If-Match”标头并且找到的文档具有不同版本,则返回412。响应还将在Etag标头中包含找到的文档的当前版本。 getDocHead(PoolNameOrSocket, CollName, Key) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgHead, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgHead, Path, [], undefined). getDocHead(PoolNameOrSocket, CollName, Key, Headers) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgHead, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgHead, Path, Headers, undefined). % 创建文档 % POST /_api/document/{collection} @@ -169,13 +169,13 @@ getDocHead(PoolNameOrSocket, CollName, Key, Headers) -> newDoc(PoolNameOrSocket, CollName, MapData) -> Path = <<"/_api/document/", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). newDoc(PoolNameOrSocket, CollName, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 替换文档 % PUT /_api/document/{collection}/{key} @@ -213,19 +213,19 @@ newDoc(PoolNameOrSocket, CollName, MapData, QueryPars) -> replaceDoc(PoolNameOrSocket, CollName, Key, MapData) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr). % 更新文档 % PATCH /_api/document/{collection}/{key} @@ -266,19 +266,19 @@ replaceDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) -> updateDoc(PoolNameOrSocket, CollName, Key, MapData) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr). % 删除文档 % DELETE /_api/document/{collection}/{key} @@ -301,17 +301,17 @@ updateDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) -> % 412:如果“如果-match”标头或返回转,并给出找到的文件有不同的版本。响应还将在_rev属性中包含找到的文档的当前修订。此外,将返回属性_id和_key。 delDoc(PoolNameOrSocket, CollName, Key) -> Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delDoc(PoolNameOrSocket, CollName, Key, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delDoc(PoolNameOrSocket, CollName, Key, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, Headers, undefined). % 批量文件操作 % ArangoDB支持批量处理文档。批量操作影响 单个集合。使用此API变体可使客户端分摊整批文档中的单个请求的开销。不能保证批量操作可以串行执行,ArangoDB 可以并行执行这些操作。这可以转化为大幅的性能提升,尤其是在集群部署中。 @@ -338,7 +338,7 @@ getDocs(PoolNameOrSocket, CollName, KeyOrMapDataList) -> QueryBinary = agMiscUtils:spellQueryPars([{onlyget, true}]), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(KeyOrMapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). getDocs(PoolNameOrSocket, CollName, KeyOrMapDataList, QueryPars) -> LastQueryPars = @@ -351,7 +351,7 @@ getDocs(PoolNameOrSocket, CollName, KeyOrMapDataList, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(LastQueryPars), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(KeyOrMapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 创建多个文档 % POST /_api/document/{collection}#multiple @@ -386,13 +386,13 @@ getDocs(PoolNameOrSocket, CollName, KeyOrMapDataList, QueryPars) -> newDocs(PoolNameOrSocket, CollName, MapDataList) -> Path = <<"/_api/document/", CollName/binary>>, BodyStr = jiffy:encode(MapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). newDocs(PoolNameOrSocket, CollName, MapDataList, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 替换多个文件 % PUT /_api/document/{collection} @@ -422,13 +422,13 @@ newDocs(PoolNameOrSocket, CollName, MapDataList, QueryPars) -> replaceDocs(PoolNameOrSocket, CollName, MapDataList) -> Path = <<"/_api/document/", CollName/binary>>, BodyStr = jiffy:encode(MapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceDocs(PoolNameOrSocket, CollName, MapDataList, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 更新多个文件 % PATCH /_api/document/{collection} @@ -461,13 +461,13 @@ replaceDocs(PoolNameOrSocket, CollName, MapDataList, QueryPars) -> updateDocs(PoolNameOrSocket, CollName, MapDataList) -> Path = <<"/_api/document/", CollName/binary>>, BodyStr = jiffy:encode(MapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateDocs(PoolNameOrSocket, CollName, MapDataList, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). % 删除多个文件 % DELETE /_api/document/{collection} @@ -491,10 +491,10 @@ updateDocs(PoolNameOrSocket, CollName, MapDataList, QueryPars) -> delDocs(PoolNameOrSocket, CollName, KeyOrMapDataList) -> Path = <<"/_api/document/", CollName/binary, "/">>, BodyStr = jiffy:encode(KeyOrMapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], BodyStr). delDocs(PoolNameOrSocket, CollName, KeyOrMapDataList, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(KeyOrMapDataList), - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], BodyStr). diff --git a/src/agApi/agEdges.erl b/src/agApi/agEdges.erl index a5c337b..370a4d0 100644 --- a/src/agApi/agEdges.erl +++ b/src/agApi/agEdges.erl @@ -40,4 +40,4 @@ getEdges(PoolNameOrSocket, CollName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/edges/", CollName/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). \ No newline at end of file + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). \ No newline at end of file diff --git a/src/agApi/agEndPoints.erl b/src/agApi/agEndPoints.erl index 3d22bf0..0324ab4 100644 --- a/src/agApi/agEndPoints.erl +++ b/src/agApi/agEndPoints.erl @@ -27,7 +27,7 @@ % 端点:协调器的绑定,例如tcp://[::1]:8530 % 501: getClusterEndpoints(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/cluster/endpoints">>, [], undefined, true). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/cluster/endpoints">>, [], undefined, true). % 所有端点的返回列表永久链接 % 此API调用返回所有端点(单个服务器)的列表。 diff --git a/src/agApi/agFoxxServices.erl b/src/agApi/agFoxxServices.erl index 3a11330..dfde519 100644 --- a/src/agApi/agFoxxServices.erl +++ b/src/agApi/agFoxxServices.erl @@ -31,11 +31,11 @@ % 返回码 % 200:如果请求成功,则返回。 getFoxxList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/foxx">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/foxx">>, [], undefined). getFoxxList(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/foxx", QueryBinary/binary>>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/foxx", QueryBinary/binary>>, [], undefined). % 服务说明 % 服务元数据 @@ -57,7 +57,7 @@ getFoxxList(PoolNameOrSocket, QueryPars) -> % 400:如果安装路径未知,则返回。 getFoxxService(PoolNameOrSocket, Mount) -> Path = <<"/_api/foxx/service?mount=", (agMiscUtils:toBinary(Mount))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 安装新服务 % POST /_api/foxx @@ -86,7 +86,7 @@ installFoxx(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 卸载服务 % DELETE /_api/foxx/service @@ -100,7 +100,7 @@ installFoxx(PoolNameOrSocket, MapData, QueryPars) -> uninstallFoxx(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/service", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 更换服务 % PUT /_api/foxx/service @@ -131,7 +131,7 @@ replaceFoxx(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/service", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 升级服务 % PATCH /_api/foxx/service @@ -162,7 +162,7 @@ upgradeFoxx(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/service", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). % Foxx服务配置/依赖关系 % 这是用于管理Foxx服务配置和依赖关系的ArangoDB HTTP接口的简介。 @@ -178,7 +178,7 @@ upgradeFoxx(PoolNameOrSocket, MapData, QueryPars) -> getFoxxConfig(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/configuration", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 更新配置选项 % PATCH /_api/foxx/configuration @@ -194,7 +194,7 @@ updateFoxxConfig(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/configuration", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). % 替换配置选项 % PUT /_api/foxx/configuration @@ -210,7 +210,7 @@ replaceFoxxConfig(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/configuration", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 获取依赖项选项 % GET /_api/foxx/dependencies @@ -223,7 +223,7 @@ replaceFoxxConfig(PoolNameOrSocket, MapData, QueryPars) -> getFoxxDependencies(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/dependencies", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 更新依赖项选项 @@ -240,7 +240,7 @@ updateFoxxDependencies(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/dependencies", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). % 替换依赖项选项 % PUT /_api/foxx/dependencies @@ -256,7 +256,7 @@ replaceFoxxDependencies(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/dependencies", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % Foxx服务杂项 % @@ -271,7 +271,7 @@ replaceFoxxDependencies(PoolNameOrSocket, MapData, QueryPars) -> getFoxxScripts(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/scripts", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 运行服务脚本 % POST /_api/foxx/scripts/{name} @@ -289,7 +289,7 @@ runFoxxScripts(PoolNameOrSocket, ScriptName, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/scripts/", ScriptName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 运行服务测试 % POST /_api/foxx/tests @@ -315,7 +315,7 @@ runFoxxScripts(PoolNameOrSocket, ScriptName, MapData, QueryPars) -> runFoxxTest(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/tests", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). % 启用开发模式 % POST /_api/foxx/development @@ -329,7 +329,7 @@ runFoxxTest(PoolNameOrSocket, QueryPars) -> enableFoxxDevelopment(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/development", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). % 禁用开发模式 % DELETE /_api/foxx/development @@ -342,7 +342,7 @@ enableFoxxDevelopment(PoolNameOrSocket, QueryPars) -> disableFoxxDevelopment(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/development", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 服务自述文件 % GET /_api/foxx/readme @@ -355,7 +355,7 @@ disableFoxxDevelopment(PoolNameOrSocket, QueryPars) -> getFoxxReadme(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/readme", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 招摇说明 % GET /_api/foxx/swagger @@ -368,7 +368,7 @@ getFoxxReadme(PoolNameOrSocket, QueryPars) -> getFoxxSwagger(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/swagger", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 下载服务包 % POST /_api/foxx/download @@ -383,7 +383,7 @@ getFoxxSwagger(PoolNameOrSocket, QueryPars) -> downloadFoxxBundle(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/download", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). % 提交本地服务状态 % POST /_api/foxx/commit @@ -396,4 +396,4 @@ downloadFoxxBundle(PoolNameOrSocket, QueryPars) -> commitFoxxState(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/foxx/commit", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). \ No newline at end of file + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). \ No newline at end of file diff --git a/src/agApi/agGeneralGraphs.erl b/src/agApi/agGeneralGraphs.erl index 316080c..597b384 100644 --- a/src/agApi/agGeneralGraphs.erl +++ b/src/agApi/agGeneralGraphs.erl @@ -29,7 +29,7 @@ % isSmart:标记图形是否为SmartGraph(仅限企业版)。 % smartGraphAttribute:智能图例中的分片属性名称(仅企业版) graphList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/gharial">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/gharial">>, [], undefined). % 创建一个图 % 在图形模块中创建一个新图形。 @@ -78,13 +78,13 @@ graphList(PoolNameOrSocket) -> % errorMessage:为此错误创建的消息。 newGraph(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/gharial">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/gharial">>, [], BodyStr). newGraph(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial", QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 获取图表 % GET /_api/gharial/{graph} @@ -102,7 +102,7 @@ newGraph(PoolNameOrSocket, MapData, QueryPars) -> % errorMessage:为此错误创建的消息。 getGraph(PoolNameOrSocket, GraphName) -> Path = <<"/_api/gharial/", GraphName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 删除现有图 % DELETE /_api/gharial/{graph} @@ -126,12 +126,12 @@ getGraph(PoolNameOrSocket, GraphName) -> % errorMessage:为此错误创建的消息。 delGraph(PoolNameOrSocket, GraphName) -> Path = <<"/_api/gharial/", GraphName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delGraph(PoolNameOrSocket, GraphName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 列出此图中使用的所有顶点集合。 % GET /_api/gharial/{graph}/vertex @@ -149,7 +149,7 @@ delGraph(PoolNameOrSocket, GraphName, QueryPars) -> % errorMessage:为此错误创建的消息。 vertexCollList(PoolNameOrSocket, GraphName) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 向图中添加一个额外的顶点集合。 % POST /_api/gharial/{graph}/vertex @@ -186,7 +186,7 @@ vertexCollList(PoolNameOrSocket, GraphName) -> addVertexColl(PoolNameOrSocket, GraphName, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex">>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 从图形中删除额外顶点集合。 % DELETE /_api/gharial/{graph}/vertex/{collection} @@ -222,12 +222,12 @@ addVertexColl(PoolNameOrSocket, GraphName, MapData) -> % errorMessage:为此错误创建的消息。 delVertexColl(PoolNameOrSocket, GraphName, CollName) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delVertexColl(PoolNameOrSocket, GraphName, CollName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 列出所有边缘定义 % GET /_api/gharial/{graph}/edge @@ -245,7 +245,7 @@ delVertexColl(PoolNameOrSocket, GraphName, CollName, QueryPars) -> % errorMessage:为此错误创建的消息。 edgeDefList(PoolNameOrSocket, GraphName) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 向图添加新的边定义 % POST /_api/gharial/{graph}/edge @@ -284,7 +284,7 @@ edgeDefList(PoolNameOrSocket, GraphName) -> addEdgeDef(PoolNameOrSocket, GraphName, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge">>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 替换现有的边缘定义 % PUT /_api/gharial/{graph}/edge/{definition}#definition @@ -328,13 +328,13 @@ addEdgeDef(PoolNameOrSocket, GraphName, MapData) -> replaceEdgeDef(PoolNameOrSocket, GraphName, EdgeDefName, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", EdgeDefName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceEdgeDef(PoolNameOrSocket, GraphName, EdgeDefName, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", EdgeDefName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 从图形中删除边缘定义 % DELETE /_api/gharial/{graph}/edge/{definition}#definition @@ -366,12 +366,12 @@ replaceEdgeDef(PoolNameOrSocket, GraphName, EdgeDefName, MapData, QueryPars) -> % errorMessage:为此错误创建的消息。 delEdgeDef(PoolNameOrSocket, GraphName, EdgeDefName) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", EdgeDefName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delEdgeDef(PoolNameOrSocket, GraphName, EdgeDefName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", EdgeDefName/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 处理顶点 @@ -410,13 +410,13 @@ delEdgeDef(PoolNameOrSocket, GraphName, EdgeDefName, QueryPars) -> newVertex(PoolNameOrSocket, GraphName, CollName, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). newVertex(PoolNameOrSocket, GraphName, CollName, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 获取现有顶点 % GET /_api/gharial/{graph}/vertex/{collection}/{vertex} @@ -461,17 +461,17 @@ newVertex(PoolNameOrSocket, GraphName, CollName, MapData, QueryPars) -> % errorMessage:为此错误创建的消息。 getVertex(PoolNameOrSocket, GraphName, CollName, VertexKey) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined). % 更新现有顶点 % PATCH /_api/gharial/{graph}/vertex/{collection}/{vertex} @@ -524,19 +524,19 @@ getVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, QueryPars, Headers) updateVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr). % 替换现有的顶点 % PUT /_api/gharial/{graph}/vertex/{collection}/{vertex} @@ -589,19 +589,19 @@ updateVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData, QueryPar replaceVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr). % 从图中删除顶点 % DELETE /_api/gharial/{graph}/vertex/{collection}/{vertex} @@ -647,17 +647,17 @@ replaceVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, MapData, QueryPa % errorMessage:为此错误创建的消息。 delVertex(PoolNameOrSocket, GraphName, CollName, VertexKey) -> Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/vertex/", CollName/binary, "/", (agMiscUtils:toBinary(VertexKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, Headers, undefined). % 处理边缘 % 在现有图形中创建边 @@ -705,13 +705,13 @@ delVertex(PoolNameOrSocket, GraphName, CollName, VertexKey, QueryPars, Headers) newEdge(PoolNameOrSocket, GraphName, CollName, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). newEdge(PoolNameOrSocket, GraphName, CollName, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 获得边 % GET /_api/gharial/{graph}/edge/{collection}/{edge} @@ -756,17 +756,17 @@ newEdge(PoolNameOrSocket, GraphName, CollName, MapData, QueryPars) -> % errorMessage:为此错误创建的消息。 getEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined). % 修改现有边 % PATCH /_api/gharial/{graph}/edge/{collection}/{edge} @@ -820,19 +820,19 @@ getEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, QueryPars, Headers) -> updateEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). updateEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData, Headers, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr). % 替换现有边的内容 @@ -888,19 +888,19 @@ updateEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData, Headers, Que replaceEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). replaceEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData, QueryPars, Headers) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr). % 从图形中删除边 % DELETE /_api/gharial/{graph}/edge/{collection}/{edge} @@ -946,16 +946,16 @@ replaceEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, MapData, QueryPars, % errorMessage:为此错误创建的消息。 delEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey) -> Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). delEdge(PoolNameOrSocket, GraphName, CollName, EdgeKey, Headers, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/gharial/", GraphName/binary, "/edge/", CollName/binary, "/", (agMiscUtils:toBinary(EdgeKey))/binary, QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, Headers, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, Headers, undefined). diff --git a/src/agApi/agHotBackup.erl b/src/agApi/agHotBackup.erl index 5b03427..3e10860 100644 --- a/src/agApi/agHotBackup.erl +++ b/src/agApi/agHotBackup.erl @@ -31,7 +31,7 @@ % 408:如果操作无法在超时时间内获得全局事务锁定,则返回HTTP 408。 newBackup(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/create">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/create">>, [], BodyStr). % 从本地备份还原 % POST /_admin/backup/restore @@ -43,7 +43,7 @@ newBackup(PoolNameOrSocket, MapData) -> % 400:如果使用错误的参数或除以外的任何HTTP方法调用了restore命令POST,则返回HTTP 400。具体细节在返回的错误文档中有详细说明。 restoreBackup(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/restore">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/restore">>, [], BodyStr). % 删除特定的本地备份 % POST /_admin/backup/delete @@ -56,7 +56,7 @@ restoreBackup(PoolNameOrSocket, MapData) -> % 404:如果id找不到与该标识符相对应的备份。 delBackup(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/delete">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/delete">>, [], BodyStr). % 列出所有本地备份 % POST /_admin/backup/list @@ -69,7 +69,7 @@ delBackup(PoolNameOrSocket, MapData) -> % 404:如果id给出了ID或ID列表,但未找到给定ID作为备份的标识符,则返回HTTP 404 NOT FOUND。 % 405:如果使用以外的任何HTTP方法调用了list命令POST,则返回HTTP 405 METHOD NOT ALLOWED。 getBackupList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/list">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/list">>, [], undefined). % 结果由list热备份的一个对象组成id,其中id唯一地标识了特定的热备份,version描绘了用于创建任何单个热备份的ArangoDB的版本,并datetime显示了创建热备份的时间。 % 其他参数包括:备份大小(以字节为单位)sizeInBytes,单个数据文件nrFiles的数量(以),创建时的数据库服务器nrDBServers的数量(以),备份部分的数量(在当前可访问的db服务器上找到的)为nrPiecesPresent。 @@ -94,7 +94,7 @@ getBackupList(PoolNameOrSocket) -> % 404:如果id 找不到对应于标识符的备份,或者没有已知的上载操作uploadId。 uploadBackup(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/upload">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/upload">>, [], BodyStr). % 下载特定的本地备份 % POST /_admin/backup/download @@ -113,4 +113,4 @@ uploadBackup(PoolNameOrSocket, MapData) -> % 404:如果id 找不到与该标识符相对应的备份,或者如果没有已知的与的下载操作downloadId。 downloadBackup(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/download">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/backup/download">>, [], BodyStr). diff --git a/src/agApi/agIndexes.erl b/src/agApi/agIndexes.erl index fa8b5fd..67e1363 100644 --- a/src/agApi/agIndexes.erl +++ b/src/agApi/agIndexes.erl @@ -58,7 +58,7 @@ % 404:如果索引不存在,则 返回HTTP 404。 getIndexInfo(PoolNameOrSocket, IndexId) -> Path = <<"/_api/index/", (agMiscUtils:toBinary(IndexId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 创建一个索引 % POST /_api/index#general @@ -88,7 +88,7 @@ getIndexInfo(PoolNameOrSocket, IndexId) -> newIndex(PoolNameOrSocket, CollName, MapData) -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr). % 删除索引 % DELETE /_api/index/{index-id} @@ -100,7 +100,7 @@ newIndex(PoolNameOrSocket, CollName, MapData) -> % 404:如果index-id未知,则返回HTTP 404。 delIndex(PoolNameOrSocket, IndexId) -> Path = <<"/_api/index/", (agMiscUtils:toBinary(IndexId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 返回集合的所有索引 % GET /_api/index @@ -111,7 +111,7 @@ delIndex(PoolNameOrSocket, IndexId) -> % 200:返回一个JSON对象,其中包含该集合的索引列表。 getIndexList(PoolNameOrSocket, CollName) -> Path = <<"/_api/index?collection=", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 使用哈希索引 % 如果存在合适的哈希索引,/_api/simple/by-example则将使用该索引执行示例查询。 @@ -140,11 +140,11 @@ newIndexOfHash(PoolNameOrSocket, CollName, MapData) -> #{type := <<"hash">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); #{<<"type">> := <<"hash">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); _ -> {error, param} end. @@ -209,11 +209,11 @@ newIndexOfSkipList(PoolNameOrSocket, CollName, MapData) -> #{type := <<"skiplist">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); #{<<"type">> := <<"skiplist">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); _ -> {error, param} end. @@ -244,11 +244,11 @@ newIndexOfPersistent(PoolNameOrSocket, CollName, MapData) -> #{type := <<"persistent">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); #{<<"type">> := <<"persistent">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); _ -> {error, param} end. @@ -274,11 +274,11 @@ newIndexOfTtl(PoolNameOrSocket, CollName, MapData) -> #{type := <<"ttl">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); #{<<"type">> := <<"ttl">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); _ -> {error, param} end. @@ -306,11 +306,11 @@ newIndexOfGeo(PoolNameOrSocket, CollName, MapData) -> #{type := <<"geo">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); #{<<"type">> := <<"geo">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); _ -> {error, param} end. @@ -378,11 +378,11 @@ newIndexOfFulltext(PoolNameOrSocket, CollName, MapData) -> #{type := <<"fulltext">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); #{<<"type">> := <<"fulltext">>} -> Path = <<"/_api/index?collection=", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr); _ -> {error, param} end. diff --git a/src/agApi/agMiscFuns.erl b/src/agApi/agMiscFuns.erl index 5498e57..11570a0 100644 --- a/src/agApi/agMiscFuns.erl +++ b/src/agApi/agMiscFuns.erl @@ -53,12 +53,12 @@ % mode:我们作为-[ 服务器,控制台,脚本 ]中的一种运行的模式 % host:主机ID srvVersion(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/version">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/version">>, [], undefined). srvVersion(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/version", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回运行服务器的引擎类型 % GET /_api/engine @@ -66,7 +66,7 @@ srvVersion(PoolNameOrSocket, QueryPars) -> % 在所有情况下均返回HTTP 200。 % 名称:将是mmfiles或rocksdb srvEngine(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/engine">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/engine">>, [], undefined). % 将WAL同步到磁盘。 % PUT /_admin/wal/flush @@ -78,12 +78,12 @@ srvEngine(PoolNameOrSocket) -> % 200:操作成功返回。 % 405:使用无效的HTTP方法时返回。 flushWal(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/wal/flush">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/wal/flush">>, [], undefined). flushWal(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_admin/wal/flush", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 获取当前配置。 % GET /_admin/wal/properties @@ -99,7 +99,7 @@ flushWal(PoolNameOrSocket, QueryPars) -> % 200:操作成功返回。 % 405:使用无效的HTTP方法时返回。 getWalProps(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/wal/properties">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/wal/properties">>, [], undefined). % 配置Wal的参数 % PUT /_admin/wal/properties @@ -116,7 +116,7 @@ getWalProps(PoolNameOrSocket) -> % 405:使用无效的HTTP方法时返回。 setWalProps(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/wal/properties">>, BodyStr, undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/wal/properties">>, BodyStr, undefined). % 返回有关当前正在运行的事务的信息 % GET /_admin/wal/transactions @@ -128,7 +128,7 @@ setWalProps(PoolNameOrSocket, MapData) -> % 200:操作成功返回。 % 405:使用无效的HTTP方法时返回。 getTransactions(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/wal/transactions">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/wal/transactions">>, [], undefined). % 获取系统的当前时间 % GET /_admin/time @@ -138,7 +138,7 @@ getTransactions(PoolNameOrSocket) -> % code:HTTP状态码 % time:当前系统时间(以Unix时间戳记为单位,服务器以微秒为单位) curDbTime(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/time">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/time">>, [], undefined). % 返回当前请求永久链接固定链接 % 发回所发送的内容,标题,帖子正文等。 @@ -172,7 +172,7 @@ curDbTime(PoolNameOrSocket) -> % rawRequestBody:已发送字符的数字列表 echo(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/echo">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/echo">>, [], BodyStr). % 返回数据库的版本。 % GET /_admin/database/target-version @@ -180,7 +180,7 @@ echo(PoolNameOrSocket, MapData) -> % 返回码 % 200:在所有情况下均返回。 targetVersion(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/database/target-version">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/database/target-version">>, [], undefined). % 启动关机序列 % DELETE /_admin/shutdown @@ -188,7 +188,7 @@ targetVersion(PoolNameOrSocket) -> % 返回码 % 200:在所有情况下OK都将返回,成功时将在结果缓冲区中返回。 shutDown(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, <<"/_admin/shutdown">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, <<"/_admin/shutdown">>, [], undefined). % 在服务器上执行脚本。 @@ -203,7 +203,7 @@ shutDown(PoolNameOrSocket) -> % 403:如果ArangoDB不在集群模式下运行,则返回。 % 404:如果未为群集操作编译ArangoDB,则返回404。 execute(PoolNameOrSocket, BodyStr) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/execute">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/execute">>, [], BodyStr). % 返回服务器的状态信息。 % GET /_admin/status @@ -237,5 +237,5 @@ execute(PoolNameOrSocket, BodyStr) -> % 返回码 % 200:状态信息返回成功 dbStatus(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/status">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/status">>, [], undefined). diff --git a/src/agApi/agRepairJobs.erl b/src/agApi/agRepairJobs.erl index 961784d..289fc34 100644 --- a/src/agApi/agRepairJobs.erl +++ b/src/agApi/agRepairJobs.erl @@ -30,7 +30,7 @@ %% 检查修复 %% GET /_admin/repairs/distributeShardsLike checkRepair(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/repairs/distributeShardsLike">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/repairs/distributeShardsLike">>, [], undefined). % 如果要修复某些内容,则响应将具有该属性 collections,/其中包含每个必须修复的集合的条目。每个集合还作为单独的error属性,true如果该集合(以及false 其他情况)发生错误,则将作为错误。如果error为true,则还将设置属性errorNum和 errorMessage,并且在某些情况下还将errorDetails 提供有关如何处理特定错误的附加信息。 % 用修复POST /_admin/repairs/distributeShardsLike @@ -72,4 +72,4 @@ checkRepair(PoolNameOrSocket) -> %% 修复 %% POST /_admin/repairs/distributeShardsLike doRepair(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/repairs/distributeShardsLike">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_admin/repairs/distributeShardsLike">>, [], undefined). diff --git a/src/agApi/agReplication.erl b/src/agApi/agReplication.erl index 3228e80..e4c612e 100644 --- a/src/agApi/agReplication.erl +++ b/src/agApi/agReplication.erl @@ -54,7 +54,7 @@ getRepInventory(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/inventory", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 创建新的转储批次 % 处理转储批处理命令 @@ -73,7 +73,7 @@ getRepInventory(PoolNameOrSocket, QueryPars) -> % 405:使用无效的HTTP方法时返回。 newRepBatch(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/replication/batch">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/replication/batch">>, [], BodyStr). % 删除现有的转储批次固定链接 % 处理转储批处理命令 @@ -89,7 +89,7 @@ newRepBatch(PoolNameOrSocket, MapData) -> % 405:使用无效的HTTP方法时返回。 delRepBatch(PoolNameOrSocket, BatchId) -> Path = <<"/_api/replication/batch/", (agMiscUtils:toBinary(BatchId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 延长现有的转储批次固定链接 % 处理转储批处理命令 @@ -112,7 +112,7 @@ delRepBatch(PoolNameOrSocket, BatchId) -> prolongRepBatch(PoolNameOrSocket, BatchId, MapData) -> Path = <<"/_api/replication/batch/", (agMiscUtils:toBinary(BatchId))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 返回集合的数据 % 返回一个集合的全部内容 @@ -144,7 +144,7 @@ prolongRepBatch(PoolNameOrSocket, BatchId, MapData) -> getRepDump(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/dump", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回Merkle树以进行收集 % 检索与集合关联的Merkle树 @@ -182,7 +182,7 @@ getRepDump(PoolNameOrSocket, QueryPars) -> getRepTree(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/revisions/tree", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 为集合永久链接重建Merkle树 % 重建与集合关联的Merkle树 @@ -202,7 +202,7 @@ getRepTree(PoolNameOrSocket, QueryPars) -> resetRepTree(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/revisions/tree", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], undefined). % 返回要求范围内的修订版ID 永久链接 % 检索请求范围内的文档的修订ID @@ -215,7 +215,7 @@ resetRepTree(PoolNameOrSocket, QueryPars) -> getRepRanges(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/revisions/ranges", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 通过修订返回文档 % 通过修订检索文档 @@ -246,7 +246,7 @@ getRepRanges(PoolNameOrSocket, QueryPars) -> getRepDoc(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/revisions/documents", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 从远程端点同步数据永久 % 开始复制 @@ -278,7 +278,7 @@ getRepDoc(PoolNameOrSocket, QueryPars) -> % 501:在集群中的协调器上调用此操作时返回。 startRepSync(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/sync">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/sync">>, [], BodyStr). % 返回集合和索引的集群清单 % 重建集群中的集合和索引的概述 @@ -294,7 +294,7 @@ startRepSync(PoolNameOrSocket, MapData) -> getRepClusterInv(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/clusterInventory", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 复制记录器命令 % 早期版本的ArangoDB允许启动,停止和配置复制记录器。这些命令在ArangoDB 2.2中是多余的,因为所有数据修改操作均写入服务器的预写日志,并且不再由单独的记录器处理。 @@ -323,7 +323,7 @@ getRepClusterInv(PoolNameOrSocket, QueryPars) -> % 405:使用无效的HTTP方法时返回。 % 500:如果无法确定记录器状态,则返回。 getRepLoggerState(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/logger-state">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/logger-state">>, [], undefined). % 返回日志条目永久链接固定链接 @@ -378,7 +378,7 @@ getRepLoggerState(PoolNameOrSocket) -> % 500:如果组装响应时发生错误,则返回500。 % 501:在集群中的协调器上调用此操作时返回。 getRepLoggerFirstTick(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/logger-first-tick">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/logger-first-tick">>, [], undefined). % 返回日志文件中可用的刻度值范围 % GET /_api/replication/logger-tick-ranges @@ -394,7 +394,7 @@ getRepLoggerFirstTick(PoolNameOrSocket) -> % 500:如果无法确定记录器状态,则返回。 % 501:在集群中的协调器上调用此操作时返回。 getRepLoggerTickRanges(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/logger-tick-ranges">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/logger-tick-ranges">>, [], undefined). % 复制应用程序命令 % applier命令允许远程启动,停止和查询ArangoDB数据库复制应用程序的状态和配置。 @@ -433,11 +433,11 @@ getRepLoggerTickRanges(PoolNameOrSocket) -> % 405:使用无效的HTTP方法时返回。 % 500:如果组装响应时发生错误,则返回500。 getRepApplierConfig(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-config">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-config">>, [], undefined). getRepApplierConfig(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-config", QueryBinary/binary>>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-config", QueryBinary/binary>>, [], undefined). % 设置申请者的配置值 % PUT /_api/replication/applier-config @@ -475,12 +475,12 @@ getRepApplierConfig(PoolNameOrSocket, QueryPars) -> % 500:如果组装响应时发生错误,则返回500。 setRepApplierConfig(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-config">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-config">>, [], BodyStr). setRepApplierConfig(PoolNameOrSocket, MapData, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-config", QueryBinary/binary>>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-config", QueryBinary/binary>>, [], BodyStr). % 启动复制应用程序 % PUT /_api/replication/applier-start @@ -496,12 +496,12 @@ setRepApplierConfig(PoolNameOrSocket, MapData, QueryPars) -> % 405:使用无效的HTTP方法时返回。 % 500:如果组装响应时发生错误,则返回500。 startRepApplier(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-start">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-start">>, [], undefined). startRepApplier(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/replication/applier-start", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 停止复制 % PUT /_api/replication/applier-stop @@ -513,11 +513,11 @@ startRepApplier(PoolNameOrSocket, QueryPars) -> % 405:使用无效的HTTP方法时返回。 % 500:如果组装响应时发生错误,则返回500。 stopRepApplier(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-stop">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-stop">>, [], undefined). stopRepApplier(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-stop", QueryBinary/binary>>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/applier-stop", QueryBinary/binary>>, [], undefined). % 输出复制的当前状态 % GET /_api/replication/applier-state @@ -559,11 +559,11 @@ stopRepApplier(PoolNameOrSocket, QueryPars) -> % 405:使用无效的HTTP方法时返回。 % 500:如果组装响应时发生错误,则返回500。 getRepApplierState(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-state">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-state">>, [], undefined). getRepApplierState(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-state", QueryBinary/binary>>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/applier-state", QueryBinary/binary>>, [], undefined). % 将角色更改为奴隶 % PUT /_api/replication/make-slave @@ -632,7 +632,7 @@ getRepApplierState(PoolNameOrSocket, QueryPars) -> % 501:在集群中的协调器上调用此操作时返回。 changeRepMakeSlave(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/make-slave">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/replication/make-slave">>, [], BodyStr). %其他复制命令 %返回服务器ID @@ -645,7 +645,7 @@ changeRepMakeSlave(PoolNameOrSocket, MapData) -> %405:使用无效的HTTP方法时返回。 %500:如果组装响应时发生错误,则返回500。 getRepServerId(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/server-id">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/replication/server-id">>, [], undefined). % WAL 固定链接操作中可用的返回刻度范围 % 返回预写日志中可用的刻度线范围 @@ -662,7 +662,7 @@ getRepServerId(PoolNameOrSocket) -> % 500:如果无法确定服务器操作状态,则返回。 % 501:在集群中的协调器上调用此操作时返回。 getWalRange(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/wal/range">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/wal/range">>, [], undefined). % 返回最后一个可用的刻度值固定链接 % 返回最后一个可用的刻度值 @@ -679,7 +679,7 @@ getWalRange(PoolNameOrSocket) -> % 500:如果组装响应时发生错误,则返回500。 % 501:在集群中的协调器上调用此操作时返回。 getWalLastTick(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/wal/lastTick">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/wal/lastTick">>, [], undefined). % 获取最近的操作 % GET /_api/wal/tail @@ -725,10 +725,10 @@ getWalLastTick(PoolNameOrSocket) -> % 500:如果组装响应时发生错误,则返回500。 % 501:在集群中的协调器上调用此操作时返回。 getWalTail(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/wal/tail">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/wal/tail">>, [], undefined). getWalTail(PoolNameOrSocket, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/wal/tail", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). diff --git a/src/agApi/agTasks.erl b/src/agApi/agTasks.erl index bfb2096..ca59ff1 100644 --- a/src/agApi/agTasks.erl +++ b/src/agApi/agTasks.erl @@ -17,7 +17,7 @@ % HTTP 200任务列表 % **:所有任务的列表 getTaskList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/tasks/">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/tasks/">>, [], undefined). % 检索一个当前活动的服务器任务 % GET /_api/tasks/{id} @@ -28,7 +28,7 @@ getTaskList(PoolNameOrSocket) -> % **:相关功能 getTask(PoolNameOrSocket, TaskId) -> Path = <<"/_api/tasks/", (agMiscUtils:toBinary(TaskId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 创建一个新任务 % POST /_api/tasks @@ -55,7 +55,7 @@ getTask(PoolNameOrSocket, TaskId) -> % 400:如果帖子正文不正确,则返回HTTP 400。 newTask(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/tasks">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/tasks">>, [], BodyStr). % 注册具有预定义ID的新任务;与负载均衡器不兼容 % PUT /_api/tasks/{id} @@ -73,7 +73,7 @@ newTask(PoolNameOrSocket, MapData) -> newTask(PoolNameOrSocket, TaskId, MapData) -> Path = <<"/_api/tasks/", (agMiscUtils:toBinary(TaskId))/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 删除一个当前活动的服务器任务 % DELETE /_api/tasks/{id} @@ -89,4 +89,4 @@ newTask(PoolNameOrSocket, TaskId, MapData) -> % errorMessage:一条纯文本消息,指出出了什么问题。 delTask(PoolNameOrSocket, TaskId) -> Path = <<"/_api/tasks/", (agMiscUtils:toBinary(TaskId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). diff --git a/src/agApi/agTransactions.erl b/src/agApi/agTransactions.erl index 0757c19..6fdea32 100644 --- a/src/agApi/agTransactions.erl +++ b/src/agApi/agTransactions.erl @@ -80,7 +80,7 @@ % 404:如果事务规范包含未知集合,则服务器将使用HTTP 404进行响应。 beginTransaction(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/transaction/begin">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/transaction/begin">>, [], BodyStr). % 提取服务器端事务的状态 % GET /_api/transaction/{transaction-id} @@ -95,7 +95,7 @@ beginTransaction(PoolNameOrSocket, MapData) -> % 404:如果找不到具有指定标识符的交易,则服务器将使用HTTP 404进行响应。 getTransactionStatus(PoolNameOrSocket, TransactionId) -> Path = <<"/_api/transaction/", (agMiscUtils:toBinary(TransactionId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 提交或中止正在运行的事务必须由客户端完成。在完成使用事务后,不要提交或中止事务是一个坏习惯。这将迫使服务器保留资源和收集锁,直到整个事务超时为止。 % 提交交易 @@ -123,7 +123,7 @@ getTransactionStatus(PoolNameOrSocket, TransactionId) -> % 409:如果事务已经中止,则服务器将使用HTTP 409进行响应。 commitTransaction(PoolNameOrSocket, TransactionId) -> Path = <<"/_api/transaction/", (agMiscUtils:toBinary(TransactionId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined). % 中止服务器端事务 % DELETE /_api/transaction/{transaction-id} @@ -149,7 +149,7 @@ commitTransaction(PoolNameOrSocket, TransactionId) -> % 409:如果事务已经提交,则服务器将以HTTP 409响应。 abortTransaction(PoolNameOrSocket, TransactionId) -> Path = <<"/_api/transaction/", (agMiscUtils:toBinary(TransactionId))/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 返回当前运行的服务器端事务 % GET /_api/transaction @@ -160,7 +160,7 @@ abortTransaction(PoolNameOrSocket, TransactionId) -> % 返回码 % 200:如果可以成功检索事务列表,则将返回HTTP 200。 getTransactionList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/transaction">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/transaction">>, [], undefined). % JavaScript交易的HTTP接口 % ArangoDB的JS事务在服务器上执行。客户端可以通过将事务描述发送给服务器来启动事务。 @@ -198,7 +198,7 @@ getTransactionList(PoolNameOrSocket) -> % 500:用户抛出的异常将使服务器以HTTP 500的返回码进行响应 executeTransaction(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/transaction">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/transaction">>, [], BodyStr). diff --git a/src/agApi/agUserMgr.erl b/src/agApi/agUserMgr.erl index 26fead2..3804736 100644 --- a/src/agApi/agUserMgr.erl +++ b/src/agApi/agUserMgr.erl @@ -29,7 +29,7 @@ % 409:如果已经存在同名用户,则返回。 newUser(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/user">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/user">>, [], BodyStr). % 设置数据库访问级别。 % PUT /_api/user/{user}/database/{dbname} @@ -49,7 +49,7 @@ newUser(PoolNameOrSocket, MapData) -> setUserDbAccessLevel(PoolNameOrSocket, UserName, DbName, MapData) -> Path = <<"/_api/user/", UserName/binary, "/database/", DbName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 设置收集访问级别。 % PUT /_api/user/{user}/database/{dbname}/{collection} @@ -71,7 +71,7 @@ setUserDbAccessLevel(PoolNameOrSocket, UserName, DbName, MapData) -> setUserCollAccessLevel(PoolNameOrSocket, UserName, DbName, CollName, MapData) -> Path = <<"/_api/user/", UserName/binary, "/database/", DbName/binary, "/", CollName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 清除数据库访问级别,恢复为默认访问级别 % DELETE /_api/user/{user}/database/{dbname} @@ -86,7 +86,7 @@ setUserCollAccessLevel(PoolNameOrSocket, UserName, DbName, CollName, MapData) -> % 400:如果JSON格式不正确或请求中缺少必需数据。。 clearUserDbAccessLevel(PoolNameOrSocket, UserName, DbName) -> Path = <<"/_api/user/", UserName/binary, "/database/", DbName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 清除集合访问级别,恢复为默认访问级别 % DELETE /_api/user/{user}/database/{dbname}/{collection} @@ -101,7 +101,7 @@ clearUserDbAccessLevel(PoolNameOrSocket, UserName, DbName) -> % 400:如果有错误 clearUserCollAccessLevel(PoolNameOrSocket, UserName, DbName, CollName) -> Path = <<"/_api/user/", UserName/binary, "/database/", DbName/binary, "/", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 列出用户的可访问数据库 % GET /_api/user/{user}/database/ @@ -119,12 +119,12 @@ clearUserCollAccessLevel(PoolNameOrSocket, UserName, DbName, CollName) -> % 403:如果您没有访问服务器访问级别,则返回。 getUserDbList(PoolNameOrSocket, UserName) -> Path = <<"/_api/user/", UserName/binary, "/database/">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). getUserDbList(PoolNameOrSocket, UserName, QueryPars) -> QueryBinary = agMiscUtils:spellQueryPars(QueryPars), Path = <<"/_api/user/", UserName/binary, "/database/", QueryBinary/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 获取特定的数据库访问级别 % GET /_api/user/{user}/database/{dbname} @@ -139,7 +139,7 @@ getUserDbList(PoolNameOrSocket, UserName, QueryPars) -> % 403:如果您没有访问服务器访问级别,则返回。 getUserDbAccessLevel(PoolNameOrSocket, UserName, DbName) -> Path = <<"/_api/user/", UserName/binary, "/database/", DbName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 获取特定集合访问级别 % GET /_api/user/{user}/database/{dbname}/{collection} @@ -155,7 +155,7 @@ getUserDbAccessLevel(PoolNameOrSocket, UserName, DbName) -> % 403:如果您没有访问服务器访问级别,则返回。 getUserCollAccessLevel(PoolNameOrSocket, UserName, DbName, CollName) -> Path = <<"/_api/user/", UserName/binary, "/database/", DbName/binary, "/", CollName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 替换现有用户属性。 % PUT /_api/user/{user} @@ -175,7 +175,7 @@ getUserCollAccessLevel(PoolNameOrSocket, UserName, DbName, CollName) -> replaceUser(PoolNameOrSocket, UserName, MapData) -> Path = <<"/_api/user/", UserName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 修改现有用户的属性 % PATCH /_api/user/{user} @@ -195,7 +195,7 @@ replaceUser(PoolNameOrSocket, UserName, MapData) -> updateUser(PoolNameOrSocket, UserName, MapData) -> Path = <<"/_api/user/", UserName/binary>>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). % 永久删除用户。 % DELETE /_api/user/{user} @@ -209,7 +209,7 @@ updateUser(PoolNameOrSocket, UserName, MapData) -> % 404:指定的用户不存在 delUser(PoolNameOrSocket, UserName) -> Path = <<"/_api/user/", UserName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). % 获取用户的属性。 % GET /_api/user/{user} @@ -223,7 +223,7 @@ delUser(PoolNameOrSocket, UserName) -> % 404:指定用户名不存在。 getUser(PoolNameOrSocket, UserName) -> Path = <<"/_api/user/", UserName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 获取用户的属性。 % GET /_api/user/ @@ -237,4 +237,4 @@ getUser(PoolNameOrSocket, UserName) -> % 401:如果您没有对_system 数据库的访问数据库访问级别,则返回。 % 403:如果您没有访问服务器访问级别,则返回。 getUserList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/user/">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/user/">>, [], undefined). diff --git a/src/agApi/agViews.erl b/src/agApi/agViews.erl index 8872b38..87c8f95 100644 --- a/src/agApi/agViews.erl +++ b/src/agApi/agViews.erl @@ -65,7 +65,7 @@ % 409:如果已经存在一个名为name的视图,则返回HTTP 409错误。 newView(PoolNameOrSocket, MapData) -> BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/view">>, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/view">>, [], BodyStr). % 返回一个视图 % GET /_api/view/{view-name} @@ -79,7 +79,7 @@ newView(PoolNameOrSocket, MapData) -> % 404:如果视图名称未知,则返回HTTP 404。 getViewInfo(PoolNameOrSocket, ViewName) -> Path = <<"/_api/view/", ViewName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 返回所有视图 % GET /_api/view @@ -90,7 +90,7 @@ getViewInfo(PoolNameOrSocket, ViewName) -> % 返回码 % 200:视图列表 getViewList(PoolNameOrSocket) -> - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/view">>, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/view">>, [], undefined). % 读取指定视图的属性 % GET /_api/view/{view-name}/properties @@ -103,7 +103,7 @@ getViewList(PoolNameOrSocket) -> % 404:如果视图名称未知,则返回HTTP 404。 getViewProps(PoolNameOrSocket, ViewName) -> Path = <<"/_api/view/", ViewName/binary, "/properties">>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined). % 更改ArangoSearch视图的所有属性 % PUT /_api/view/{view-name}/properties#ArangoSearch @@ -141,7 +141,7 @@ getViewProps(PoolNameOrSocket, ViewName) -> changeViewAllProps(PoolNameOrSocket, ViewName, MapData) -> Path = <<"/_api/view/", ViewName/binary, "/properties">>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr). % 部分更改ArangoSearch视图的属性 % PATCH /_api/view/{view-name}/properties#ArangoSearch @@ -179,7 +179,7 @@ changeViewAllProps(PoolNameOrSocket, ViewName, MapData) -> changeViewPartProps(PoolNameOrSocket, ViewName, MapData) -> Path = <<"/_api/view/", ViewName/binary, "/properties">>, BodyStr = jiffy:encode(MapData), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr). % 重命名视图 % PUT /_api/view/{view-name}/rename @@ -198,7 +198,7 @@ changeViewPartProps(PoolNameOrSocket, ViewName, MapData) -> renameView(PoolNameOrSocket, ViewName, NewViewName) -> Path = <<"/_api/view/", ViewName/binary, "/rename">>, NameStr = jiffy:encode(NewViewName), - agHttpCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], <<"{\"name\":", NameStr/binary, "}">>). + agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], <<"{\"name\":", NameStr/binary, "}">>). % 删除视图 % DELETE /_api/view/{view-name} @@ -213,4 +213,4 @@ renameView(PoolNameOrSocket, ViewName, NewViewName) -> % 404:如果视图名称未知,则返回HTTP 404。 delView(PoolNameOrSocket, ViewName) -> Path = <<"/_api/view/", ViewName/binary>>, - agHttpCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). + agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined). diff --git a/src/agHttpCli/agAgencyPoolMgrExm.erl b/src/agVstCli/agAgencyPoolMgrExm.erl similarity index 100% rename from src/agHttpCli/agAgencyPoolMgrExm.erl rename to src/agVstCli/agAgencyPoolMgrExm.erl diff --git a/src/agHttpCli/agAgencyPoolMgrIns.erl b/src/agVstCli/agAgencyPoolMgrIns.erl similarity index 100% rename from src/agHttpCli/agAgencyPoolMgrIns.erl rename to src/agVstCli/agAgencyPoolMgrIns.erl diff --git a/src/agHttpCli/agAgencyPool_sup.erl b/src/agVstCli/agAgencyPool_sup.erl similarity index 100% rename from src/agHttpCli/agAgencyPool_sup.erl rename to src/agVstCli/agAgencyPool_sup.erl diff --git a/src/agHttpCli/agAgencyUtils.erl b/src/agVstCli/agAgencyUtils.erl similarity index 100% rename from src/agHttpCli/agAgencyUtils.erl rename to src/agVstCli/agAgencyUtils.erl diff --git a/src/agHttpCli/agHttpProtocol.erl b/src/agVstCli/agHttpProtocol.erl similarity index 100% rename from src/agHttpCli/agHttpProtocol.erl rename to src/agVstCli/agHttpProtocol.erl diff --git a/src/agHttpCli/agKvsToBeam.erl b/src/agVstCli/agKvsToBeam.erl similarity index 100% rename from src/agHttpCli/agKvsToBeam.erl rename to src/agVstCli/agKvsToBeam.erl diff --git a/src/agHttpCli/agMiscUtils.erl b/src/agVstCli/agMiscUtils.erl similarity index 100% rename from src/agHttpCli/agMiscUtils.erl rename to src/agVstCli/agMiscUtils.erl diff --git a/src/agHttpCli/agSslAgencyExm.erl b/src/agVstCli/agSslAgencyExm.erl similarity index 100% rename from src/agHttpCli/agSslAgencyExm.erl rename to src/agVstCli/agSslAgencyExm.erl diff --git a/src/agHttpCli/agSslAgencyIns.erl b/src/agVstCli/agSslAgencyIns.erl similarity index 100% rename from src/agHttpCli/agSslAgencyIns.erl rename to src/agVstCli/agSslAgencyIns.erl diff --git a/src/agHttpCli/agTcpAgencyExm.erl b/src/agVstCli/agTcpAgencyExm.erl similarity index 100% rename from src/agHttpCli/agTcpAgencyExm.erl rename to src/agVstCli/agTcpAgencyExm.erl diff --git a/src/agHttpCli/agTcpAgencyIns.erl b/src/agVstCli/agTcpAgencyIns.erl similarity index 100% rename from src/agHttpCli/agTcpAgencyIns.erl rename to src/agVstCli/agTcpAgencyIns.erl diff --git a/src/agHttpCli/agVstAgencyExm.erl b/src/agVstCli/agVstAgencyExm.erl similarity index 100% rename from src/agHttpCli/agVstAgencyExm.erl rename to src/agVstCli/agVstAgencyExm.erl diff --git a/src/agHttpCli/agVstAgencyIns.erl b/src/agVstCli/agVstAgencyIns.erl similarity index 100% rename from src/agHttpCli/agVstAgencyIns.erl rename to src/agVstCli/agVstAgencyIns.erl diff --git a/src/agHttpCli/agHttpCli.erl b/src/agVstCli/agVstCli.erl similarity index 99% rename from src/agHttpCli/agHttpCli.erl rename to src/agVstCli/agVstCli.erl index cb94bad..1e8e7e0 100644 --- a/src/agHttpCli/agHttpCli.erl +++ b/src/agVstCli/agVstCli.erl @@ -1,4 +1,4 @@ --module(agHttpCli). +-module(agVstCli). -include("agHttpCli.hrl"). -include("eArango.hrl"). diff --git a/src/agHttpCli/vst.erl b/src/agVstCli/vst.erl similarity index 100% rename from src/agHttpCli/vst.erl rename to src/agVstCli/vst.erl diff --git a/src/user_default.erl b/src/user_default.erl index 6af6c57..a94e415 100644 --- a/src/user_default.erl +++ b/src/user_default.erl @@ -6,11 +6,11 @@ start() -> erlSync:run(), application:ensure_all_started(erlArango), - agHttpCli:startPool(tt, [{poolSize, 10}], []). + agVstCli:startPool(tt, [{poolSize, 10}], []). tt(C, N) -> application:ensure_all_started(erlArango), - agHttpCli:startPool(tt, [{poolSize, 16}], []), + agVstCli:startPool(tt, [{poolSize, 16}], []), StartTime = erlang:system_time(millisecond), io:format("IMY********************** started~n"), [spawn(?MODULE, test, [N, StartTime]) || _Idx <- lists:seq(1, C)].