Browse Source

改动

master
SisMaker 4 years ago
parent
commit
0efbc517b5
5 changed files with 62 additions and 87 deletions
  1. +2
    -0
      src/agApi/agBulkImportExport.erl
  2. +5
    -6
      src/agApi/agCluster.erl
  3. +33
    -54
      src/agApi/agCollections.erl
  4. +5
    -5
      src/agApi/agDbMgr.erl
  5. +17
    -22
      src/agApi/agDocuments.erl

+ 2
- 0
src/agApi/agBulkImportExport.erl View File

@ -5,6 +5,8 @@
-compile({inline_size, 128}).
-compile([export_all, nowarn_export_all]).
%% IMY-todo json
% doc_address:https://www.arangodb.com/docs/stable/http/bulk-imports.html
% HTTP接口

+ 5
- 6
src/agApi/agCluster.erl View File

@ -25,7 +25,7 @@
% 200
% 500
serverId(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/id">>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/id">>).
%
% GET /_admin/server/role
@ -42,7 +42,7 @@ serverId(PoolNameOrSocket) ->
% errorNum
% role[ SINGLECOORDINATORPRIMARYSECONDARYAGENTUNDEFINED ]
serverRole(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/role">>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/server/role">>).
%
% DB-Server的统计信息
@ -54,8 +54,7 @@ serverRole(PoolNameOrSocket) ->
% 400ID
% 403
clusterStats(PoolNameOrSocket, QueryPars) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/clusterStatistics", QueryBinary/binary>>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/clusterStatistics">>, QueryPars, ?AgDefHeader, ?AgDefBody).
%
% GET /_admin/cluster/health
@ -85,7 +84,7 @@ clusterStats(PoolNameOrSocket, QueryPars) ->
%
% 200
clusterHealth(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/cluster/health">>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_admin/cluster/health">>).
%
% PUT /_admin/cluster/maintenance
@ -97,7 +96,7 @@ clusterHealth(PoolNameOrSocket) ->
% 501
% 504
setClusterMaintenance(PoolNameOrSocket, OnOrOff) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/cluster/maintenance">>, [], OnOrOff).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_admin/cluster/maintenance">>, ?AgDefQuery, ?AgDefHeader, eVPack:encodeBin(OnOrOff)).
%%%%%%%%%%%%%%% Agency ??????????????????????????

+ 33
- 54
src/agApi/agCollections.erl View File

@ -93,13 +93,11 @@
newColl(PoolNameOrSocket, MapData) ->
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/collection">>, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/collection">>, ?AgDefQuery, ?AgDefHeader, BodyStr).
newColl(PoolNameOrSocket, MapData, QueryPars) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/collection", QueryBinary/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/collection">>, QueryPars, ?AgDefHeader, BodyStr).
%
% DELETE /_api/collection/{collection-name}
@ -117,17 +115,11 @@ newColl(PoolNameOrSocket, MapData, QueryPars) ->
% 404HTTP 404
delColl(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path).
delColl(PoolNameOrSocket, CollName, IsSystem) ->
case IsSystem of
true ->
Path = <<"/_api/collection/", CollName/binary, "?isSystem=true">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined);
_ ->
Path = <<"/_api/collection/", CollName/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined)
end.
delColl(PoolNameOrSocket, CollName, QueryPars) ->
Path = <<"/_api/collection/", CollName/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, QueryPars, ?AgDefHeader, ?AgDefBody).
%
% PUT /_api/collection/{collection-name}/truncate
@ -140,7 +132,7 @@ delColl(PoolNameOrSocket, CollName, IsSystem) ->
% 404 HTTP 404
clearColl(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/truncate">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path).
%
% GET /_api/collection/{collection-name}
@ -166,7 +158,7 @@ clearColl(PoolNameOrSocket, CollName) ->
% 404HTTP 404
collInfo(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
%
@ -179,7 +171,7 @@ collInfo(PoolNameOrSocket, CollName) ->
% HTTP 200
collProps(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", (CollName)/binary, "/properties">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
%
% GET /_api/collection/{collection-name}/count
@ -193,7 +185,7 @@ collProps(PoolNameOrSocket, CollName) ->
% 404 HTTP 404
collCount(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/count">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
%
% GET /_api/collection/{collection-name}/figures
@ -211,7 +203,7 @@ collCount(PoolNameOrSocket, CollName) ->
% 404 HTTP 404
collFigures(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/figures">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
%
% PUT /_api/collection/{collection-name}/responsibleShard
@ -232,7 +224,7 @@ collFigures(PoolNameOrSocket, CollName) ->
collResponsibleShard(PoolNameOrSocket, CollName, MapData) ->
Path = <<"/_api/collection/", CollName/binary, "/responsibleShard">>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, ?AgDefQuery, ?AgDefHeader, BodyStr).
% ID
% GET /_api/collection/{collection-name}/shards
@ -250,17 +242,11 @@ collResponsibleShard(PoolNameOrSocket, CollName, MapData) ->
% 501HTTP 501
collShards(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/shards">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
collShards(PoolNameOrSocket, CollName, IsDetails) ->
case IsDetails of
true ->
Path = <<"/_api/collection/", CollName/binary, "/shards?details=true">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined);
_ ->
Path = <<"/_api/collection/", CollName/binary, "/shards">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined)
end.
collShards(PoolNameOrSocket, CollName, QueryPars) ->
Path = <<"/_api/collection/", CollName/binary, "/shards">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, QueryPars, ?AgDefHeader, ?AgDefBody).
% ID
% GET /_api/collection/{collection-name}/revision
@ -274,7 +260,7 @@ collShards(PoolNameOrSocket, CollName, IsDetails) ->
% 404 HTTP 404
collRev(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/revision">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
%
% GET /_api/collection/{collection-name}/checksum
@ -298,12 +284,11 @@ collRev(PoolNameOrSocket, CollName) ->
% 404 HTTP 404
collChecksum(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/checksum">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
collChecksum(PoolNameOrSocket, CollName, QueryPars) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/collection/", CollName/binary, "/checksum", QueryBinary/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
Path = <<"/_api/collection/", CollName/binary, "/checksum">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, QueryPars, ?AgDefHeader, ?AgDefBody).
%
% GET /_api/collection
@ -315,16 +300,10 @@ collChecksum(PoolNameOrSocket, CollName, QueryPars) ->
%
% 200
collList(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>).
collList(PoolNameOrSocket, IsExcludeSystem) ->
case IsExcludeSystem of
false ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, [], undefined);
_ ->
Path = <<"/_api/collection?excludeSystem=true">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined)
end.
collList(PoolNameOrSocket, QueryPars) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/collection">>, QueryPars, ?AgDefHeader, ?AgDefBody).
%
% PUT /_api/collection/{collection-name}/load
@ -348,11 +327,11 @@ collList(PoolNameOrSocket, IsExcludeSystem) ->
% 404 HTTP 404
loadColl(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/load">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path).
loadColl(PoolNameOrSocket, CollName, MapData) ->
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/collection/", CollName/binary, "/load">>, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, <<"/_api/collection/", CollName/binary, "/load">>, ?AgDefQuery, ?AgDefHeader, BodyStr).
%
% PUT /_api/collection/{collection-name}/unload
@ -371,7 +350,7 @@ loadColl(PoolNameOrSocket, CollName, MapData) ->
% 404HTTP 404
unloadColl(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/unload">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path).
%
% PUT /_api/collection/{collection-name}/loadIndexesIntoMemory
@ -387,7 +366,7 @@ unloadColl(PoolNameOrSocket, CollName) ->
% 404HTTP 404
collLoadIndexesIntoMemory(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/loadIndexesIntoMemory">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path).
%
% PUT /_api/collection/{collection-name}/properties
@ -422,7 +401,7 @@ collLoadIndexesIntoMemory(PoolNameOrSocket, CollName) ->
collChangeProps(PoolNameOrSocket, CollName, MapData) ->
Path = <<"/_api/collection/", CollName/binary, "/properties">>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, ?AgDefQuery, ?AgDefHeader, BodyStr).
%
% PUT /_api/collection/{collection-name}/rename
@ -444,10 +423,10 @@ collChangeProps(PoolNameOrSocket, CollName, MapData) ->
%
% 400HTTP 400
% 404 HTTP 404
renameColl(PoolNameOrSocket, OldName, NewName) ->
renameColl(PoolNameOrSocket, OldName, MapData) ->
Path = <<"/_api/collection/", OldName/binary, "/rename">>,
NameStr = eVPack:encodeBin(NewName),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], <<"{\"name\":", NameStr/binary, "}">>).
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, ?AgDefQuery, ?AgDefQuery, BodyStr).
%
% PUT /_api/collection/{collection-name}/rotate
@ -464,7 +443,7 @@ renameColl(PoolNameOrSocket, OldName, NewName) ->
% 3.7
collRotate(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/rotate">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path).
%
% PUT /_api/collection/{collection-name}/recalculateCount
@ -479,4 +458,4 @@ collRotate(PoolNameOrSocket, CollName) ->
% 404HTTP 404
collRecount(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/recalculateCount">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path).

+ 5
- 5
src/agApi/agDbMgr.erl View File

@ -34,7 +34,7 @@
% 400
% 404
curDbInfo(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/current">>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/current">>).
% 访
% GET /_api/database/user
@ -43,7 +43,7 @@ curDbInfo(PoolNameOrSocket) ->
% 200
% 400
visitDbs(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/user">>, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database/user">>).
%
% GET /_api/database
@ -55,7 +55,7 @@ visitDbs(PoolNameOrSocket) ->
% 400
% 403_system数据库中执行
allDbs(PoolNameOrSocket) ->
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database">>, [], undefined, true).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/database">>, ?AgDefQuery, ?AgDefHeader, ?AgDefBody, true).
%
% POST /_api/database
@ -80,7 +80,7 @@ allDbs(PoolNameOrSocket) ->
% 409
newDb(PoolNameOrSocket, MapData) ->
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/database">>, [], BodyStr, true).
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/database">>, ?AgDefQuery, ?AgDefHeader, BodyStr, true).
%
% DELETE /_api/database/{database-name}
@ -95,4 +95,4 @@ newDb(PoolNameOrSocket, MapData) ->
% 404
delDb(PoolNameOrSocket, Name) ->
Path = <<"/_api/database/", Name/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, [], undefined, true).
agVstCli:callAgency(PoolNameOrSocket, ?AgDelete, Path, ?AgDefQuery, ?AgDefHeader, ?AgDefBody, true).

+ 17
- 22
src/agApi/agDocuments.erl View File

@ -102,11 +102,11 @@
% 412 If-Match412_rev属性中包含找到的文档的当前修订_id和_key
getDoc(PoolNameOrSocket, CollName, Key) ->
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
getDoc(PoolNameOrSocket, CollName, Key, Headers) ->
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, Headers, undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, ?AgDefQuery, Headers, ?AgDefBody).
%
% HEAD /_api/document/{collection}/{key}
@ -124,11 +124,11 @@ getDoc(PoolNameOrSocket, CollName, Key, Headers) ->
% 412 If-Match412Etag标头中包含找到的文档的当前版本
getDocHead(PoolNameOrSocket, CollName, Key) ->
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgHead, Path, [], undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgHead, Path).
getDocHead(PoolNameOrSocket, CollName, Key, Headers) ->
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
agVstCli:callAgency(PoolNameOrSocket, ?AgHead, Path, Headers, undefined).
agVstCli:callAgency(PoolNameOrSocket, ?AgHead, Path, ?AgDefQuery, Headers, ?AgDefBody).
%
% POST /_api/document/{collection}
@ -169,13 +169,12 @@ getDocHead(PoolNameOrSocket, CollName, Key, Headers) ->
newDoc(PoolNameOrSocket, CollName, MapData) ->
Path = <<"/_api/document/", CollName/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, ?AgDefQuery, ?AgDefHeader, BodyStr).
newDoc(PoolNameOrSocket, CollName, MapData, QueryPars) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/document/", CollName/binary, QueryBinary/binary>>,
Path = <<"/_api/document/", CollName/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPost, Path, QueryPars, ?AgDefHeader, BodyStr).
%
% PUT /_api/document/{collection}/{key}
@ -213,19 +212,17 @@ newDoc(PoolNameOrSocket, CollName, MapData, QueryPars) ->
replaceDoc(PoolNameOrSocket, CollName, Key, MapData) ->
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, ?AgDefQuery, ?AgDefHeader, BodyStr).
replaceDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>,
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, QueryPars, ?AgDefHeader, BodyStr).
replaceDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>,
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, Headers, BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, QueryPars, Headers, BodyStr).
%
% PATCH /_api/document/{collection}/{key}
@ -266,19 +263,17 @@ replaceDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) ->
updateDoc(PoolNameOrSocket, CollName, Key, MapData) ->
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, ?AgDefQuery, ?AgDefHeader, BodyStr).
updateDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>,
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, [], BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, QueryPars, ?AgDefHeader, BodyStr).
updateDoc(PoolNameOrSocket, CollName, Key, MapData, QueryPars, Headers) ->
QueryBinary = agMiscUtils:spellQueryPars(QueryPars),
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary, QueryBinary/binary>>,
Path = <<"/_api/document/", CollName/binary, "/", (agMiscUtils:toBinary(Key))/binary>>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, Headers, BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPatch, Path, QueryPars, Headers, BodyStr).
%
% DELETE /_api/document/{collection}/{key}

Loading…
Cancel
Save