hanbaoshan
2020-09-14 19d871dc4f3bd48e0906868ba5b35a457b128964
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import request from "@/scripts/httpRequest";
import qs from "qs";
 
// 获取随机密码
export const randomPwd = (query: any) => {
  return request({
    url: "/data/api-v/cluster/randomPwd",
    method: "get",
    params: query
  });
};
 
// 创建集群
export const createColony = (query: any) => {
  return request({
    url: "/data/api-v/cluster/create",
    method: "post",
    data: query
  })
};
 
// 搜索集群
export const search = (query: any) => {
  return request({
    url: "/data/api-v/cluster/search",
    method: "post",
    data: query
  })
};
 
// 调search后,通过此接口获取查到的集群节点信息
export const getSearchNodes = (query: any) => {
  return request({
    url: "/data/api-v/cluster/getSearchNodes",
    method: "get",
    params: query
  });
};
 
// 停止搜索
export const stopSearching = (query: any) => {
  return request({
    url: "/data/api-v/cluster/stopSearching",
    method: "post",
    data: query
  })
};
 
// 查询本地集群
export const findCluster = (query: any) => {
  return request({
    url: "/data/api-v/cluster/findCluster",
    method: "get",
    params: query
  });
};
 
// 保存集群名称
export const updateClusterName = (query: any) => {
  return request({
    url: '/data/api-v/cluster/updateClusterName',
    method: 'post',
    data: qs.stringify(query)
  })
};
 
// 加入集群
export const joinCluster = (query: any) => {
  return request({
    url: "/data/api-v/cluster/joinCluster",
    method: "post",
    headers: {
      "Content-Type": "application/json; charset=UTF-8"
    },
    data: query
  })
};
 
// 退出集群
export const leave = (query: any) => {
  return request({
    url: "/data/api-v/cluster/leave",
    method: "post",
    data: query
  })
};
 
// 获取漂移ip设置
export const getVrrp = () => {
  return request({
    url: "/vrrp",
    method: "get"
  })
};
 
// 设置漂移ip设置
export const setVrrp = (data: any) => {
  return request({
    url: "/vrrp",
    method: "post",
    data
  })
}