This is an automated email from the ASF dual-hosted git repository.
tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 4667e6e feat: put server_info under the admin api (#1076)
4667e6e is described below
commit 4667e6ede0e26fd0b0463943a2f1092a48e9d0ff
Author: 琚致远 <[email protected]>
AuthorDate: Sat Dec 19 12:50:14 2020 +0800
feat: put server_info under the admin api (#1076)
---
api/internal/handler/server_info/server_info.go | 4 ++--
api/test/e2e/server_info_test.go | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/api/internal/handler/server_info/server_info.go
b/api/internal/handler/server_info/server_info.go
index 23ead6d..0b3f529 100644
--- a/api/internal/handler/server_info/server_info.go
+++ b/api/internal/handler/server_info/server_info.go
@@ -41,9 +41,9 @@ func NewHandler() (handler.RouteRegister, error) {
}
func (h *Handler) ApplyRoute(r *gin.Engine) {
- r.GET("/apisix/server_info/:id", wgin.Wraps(h.Get,
+ r.GET("/apisix/admin/server_info/:id", wgin.Wraps(h.Get,
wrapper.InputType(reflect.TypeOf(GetInput{}))))
- r.GET("/apisix/server_info", wgin.Wraps(h.List,
+ r.GET("/apisix/admin/server_info", wgin.Wraps(h.List,
wrapper.InputType(reflect.TypeOf(ListInput{}))))
}
diff --git a/api/test/e2e/server_info_test.go b/api/test/e2e/server_info_test.go
index 8e2f069..bbe9c50 100644
--- a/api/test/e2e/server_info_test.go
+++ b/api/test/e2e/server_info_test.go
@@ -29,7 +29,7 @@ func TestServerInfo_Get(t *testing.T) {
{
caseDesc: "get server info",
Object: ManagerApiExpect(t),
- Path: "/apisix/server_info/apisix-server1",
+ Path:
"/apisix/admin/server_info/apisix-server1",
Method: http.MethodGet,
Headers: map[string]string{"Authorization": token},
ExpectStatus: http.StatusOK,
@@ -38,7 +38,7 @@ func TestServerInfo_Get(t *testing.T) {
{
caseDesc: "get server info",
Object: ManagerApiExpect(t),
- Path: "/apisix/server_info/apisix-server2",
+ Path:
"/apisix/admin/server_info/apisix-server2",
Method: http.MethodGet,
Headers: map[string]string{"Authorization": token},
ExpectStatus: http.StatusOK,
@@ -56,7 +56,7 @@ func TestServerInfo_List(t *testing.T) {
{
caseDesc: "list all server info",
Object: ManagerApiExpect(t),
- Path: "/apisix/server_info",
+ Path: "/apisix/admin/server_info",
Method: http.MethodGet,
Headers: map[string]string{"Authorization": token},
ExpectStatus: http.StatusOK,
@@ -65,7 +65,7 @@ func TestServerInfo_List(t *testing.T) {
{
caseDesc: "list server info with hostname",
Object: ManagerApiExpect(t),
- Path: "/apisix/server_info",
+ Path: "/apisix/admin/server_info",
Query: "hostname=apisix_",
Method: http.MethodGet,
Headers: map[string]string{"Authorization": token},
@@ -75,7 +75,7 @@ func TestServerInfo_List(t *testing.T) {
{
caseDesc: "list server info with hostname",
Object: ManagerApiExpect(t),
- Path: "/apisix/server_info",
+ Path: "/apisix/admin/server_info",
Query: "hostname=apisix_server2",
Method: http.MethodGet,
Headers: map[string]string{"Authorization": token},