chore(gw): change lwm2m&coap api path

This commit is contained in:
JianBo He 2021-11-24 10:57:32 +08:00
parent 68a7c096b0
commit bc012d6554
4 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@
-export([request/2]).
-define(PREFIX, "/gateway/coap/:clientid").
-define(PREFIX, "/gateway/coap/clients/:clientid").
-define(DEF_WAIT_TIME, 10).
-import(emqx_mgmt_util, [ schema/1

View File

@ -23,7 +23,7 @@
-export([lookup_cmd/2, observe/2, read/2, write/2]).
-define(PATH(Suffix), "/gateway/lwm2m/:clientid"Suffix).
-define(PATH(Suffix), "/gateway/lwm2m/clients/:clientid"Suffix).
-define(DATA_TYPE, ['Integer', 'Float', 'Time', 'String', 'Boolean', 'Opaque', 'Objlnk']).
-import(hoconsc, [mk/2, ref/1, ref/2]).

View File

@ -67,7 +67,7 @@ end_per_suite(Config) ->
t_send_request_api(_) ->
ClientId = start_client(),
timer:sleep(200),
Path = emqx_mgmt_api_test_util:api_path(["gateway/coap/client1/request"]),
Path = emqx_mgmt_api_test_util:api_path(["gateway/coap/clients/client1/request"]),
Token = <<"atoken">>,
Payload = <<"simple echo this">>,
Req = #{token => Token,

View File

@ -301,7 +301,7 @@ t_observe(Config) ->
%%% Internal Functions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
call_lookup_api(ClientId, Path, Action) ->
ApiPath = emqx_mgmt_api_test_util:api_path(["gateway/lwm2m", ClientId, "lookup_cmd"]),
ApiPath = emqx_mgmt_api_test_util:api_path(["gateway/lwm2m/clients", ClientId, "lookup_cmd"]),
Auth = emqx_mgmt_api_test_util:auth_header_(),
Query = io_lib:format("path=~ts&action=~ts", [Path, Action]),
{ok, Response} = emqx_mgmt_api_test_util:request_api(get, ApiPath, Query, Auth),
@ -309,7 +309,7 @@ call_lookup_api(ClientId, Path, Action) ->
Response.
call_send_api(ClientId, Cmd, Query) ->
ApiPath = emqx_mgmt_api_test_util:api_path(["gateway/lwm2m", ClientId, Cmd]),
ApiPath = emqx_mgmt_api_test_util:api_path(["gateway/lwm2m/clients", ClientId, Cmd]),
Auth = emqx_mgmt_api_test_util:auth_header_(),
{ok, Response} = emqx_mgmt_api_test_util:request_api(post, ApiPath, Query, Auth),
?LOGT("rest api response:~ts~n", [Response]),