فهرست منبع

cluster state endpoint

Stefan McShane 3 سال پیش
والد
کامیت
fbf9e9e3bd
1فایلهای تغییر یافته به همراه19 افزوده شده و 19 حذف شده
  1. 19 19
      api/server/router/cluster.go

+ 19 - 19
api/server/router/cluster.go

@@ -1012,66 +1012,66 @@ func getClusterRoutes(
 		Router:   r,
 	})
 
-	// GET /api/projects/{project_id}/clusters/{cluster_id}/{kind}/status -> cluster.NewStreamStatusHandler
-	streamStatusEndpoint := factory.NewAPIEndpoint(
+	// GET /api/projects/{project_id}/clusters/{cluster_id}/state -> cluster.NewClusterStatusHandler
+	clusterStatusEndpoint := factory.NewAPIEndpoint(
 		&types.APIRequestMetadata{
 			Verb:   types.APIVerbGet,
 			Method: types.HTTPVerbGet,
 			Path: &types.Path{
-				Parent: basePath,
-				RelativePath: fmt.Sprintf(
-					"%s/{%s}/status",
-					relPath,
-					types.URLParamKind,
-				),
+				Parent:       basePath,
+				RelativePath: relPath + "/state",
 			},
 			Scopes: []types.PermissionScope{
 				types.UserScope,
 				types.ProjectScope,
 				types.ClusterScope,
 			},
-			IsWebsocket: true,
 		},
 	)
 
-	streamStatusHandler := cluster.NewStreamStatusHandler(
+	clusterStatusHandler := cluster.NewClusterStatusHandler(
 		config,
 		factory.GetDecoderValidator(),
 		factory.GetResultWriter(),
 	)
 
 	routes = append(routes, &router.Route{
-		Endpoint: streamStatusEndpoint,
-		Handler:  streamStatusHandler,
+		Endpoint: clusterStatusEndpoint,
+		Handler:  clusterStatusHandler,
 		Router:   r,
 	})
 
-	// GET /api/projects/{project_id}/clusters/{cluster_id}/status -> cluster.NewClusterStatusHandler
-	clusterStatusEndpoint := factory.NewAPIEndpoint(
+	// GET /api/projects/{project_id}/clusters/{cluster_id}/{kind}/status -> cluster.NewStreamStatusHandler
+	streamStatusEndpoint := factory.NewAPIEndpoint(
 		&types.APIRequestMetadata{
 			Verb:   types.APIVerbGet,
 			Method: types.HTTPVerbGet,
 			Path: &types.Path{
-				Parent:       basePath,
-				RelativePath: relPath + "/status",
+				Parent: basePath,
+				RelativePath: fmt.Sprintf(
+					"%s/{%s}/status",
+					relPath,
+					types.URLParamKind,
+				),
 			},
 			Scopes: []types.PermissionScope{
 				types.UserScope,
 				types.ProjectScope,
 				types.ClusterScope,
 			},
+			IsWebsocket: true,
 		},
 	)
 
-	clusterStatusHandler := cluster.NewClusterStatusHandler(
+	streamStatusHandler := cluster.NewStreamStatusHandler(
 		config,
 		factory.GetDecoderValidator(),
 		factory.GetResultWriter(),
 	)
 
 	routes = append(routes, &router.Route{
-		Endpoint: clusterStatusEndpoint,
-		Handler:  clusterStatusHandler,
+		Endpoint: streamStatusEndpoint,
+		Handler:  streamStatusHandler,
 		Router:   r,
 	})