负载均衡(upstream)接口

获取upstream分页列表

URL: http://your_ip:port/api/upstream/getPage

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 获取upstream分页列表

Request-parameters:

ParameterTypeDescriptionRequiredSince
currentint32当前页数(从1开始)true-
limitint32每页数量(默认为10)true-
keywordsstring查询关键字true-

Request-example:

curl   -i http://your_ip:port/api/upstream/getPage?keywords=il4qyy&current=7gzzcb&limit=10

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-
└─countint64总记录数-
└─currint32起始页(从1开始)-
└─limitint32每页记录数-
└─recordsarray列表内容-
     └─idstring主键-
     └─namestring负载均衡名称-
     └─tacticsstring负载策略: '':无(默认) 'sticky':会话保持 'ip_hash':ip绑定 'least_conn':最少连接 'least_time':最短时间-
     └─proxyTypeint32代理类型 0:http(默认) 1:tcp/udp-
     └─monitorint32监控邮件通知 0:否(默认) 1:是-

Response-example:

{
	"success":true,
	"status":"35c1i9",
	"msg":"sv9i6d",
	"obj":{
		"count":788,
		"curr":672,
		"limit":10,
		"records":[
			{
				"id":"45",
				"name":"鹤轩.白",
				"tactics":"iytgxk",
				"proxyType":355,
				"monitor":427
			}
		]
	}
}

添加或编辑upstream

URL: http://your_ip:port/api/upstream/insertOrUpdate

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 添加或编辑upstream

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstring主键false-
namestring负载均衡名称true-
tacticsstring负载策略: '':无(默认) 'sticky':会话保持 'ip_hash':ip绑定 'least_conn':最少连接 'least_time':最短时间false-
proxyTypeint32代理类型 0:http(默认) 1:tcp/udpfalse-
monitorint32监控邮件通知 0:否(默认) 1:是false-

Request-example:

curl   -i http://your_ip:port/api/upstream/insertOrUpdate?monitor=375&seq=601&name=鹤轩.白&createTime=1641871596310&proxyType=161&updateTime=1641871596310&id=45&tactics=u1w8hj

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"exbvq7",
	"msg":"ztgxoa",
	"obj":{
		
	}
}

删除upstream

URL: http://your_ip:port/api/upstream/delete

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 删除upstream

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstringupstream的idtrue-

Request-example:

curl   -i http://your_ip:port/api/upstream/delete?id=45

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"d7usdq",
	"msg":"8w31e6",
	"obj":{
		
	}
}

根据upstreamId获取server列表

URL: http://your_ip:port/api/upstream/getServerByUpstreamId

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 根据upstreamId获取server列表

Request-parameters:

ParameterTypeDescriptionRequiredSince
upstreamIdstringupstream的idtrue-

Request-example:

curl   -i http://your_ip:port/api/upstream/getServerByUpstreamId?upstreamId=45

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-
└─idstring主键-
└─upstreamIdstring负载均衡upstream的id-
└─serverstring负载节点ip (例:10.10.10.1)-
└─portint32负载节点端口 (例:8080)-
└─weightint32负载节点权重-
└─failTimeoutint32失败等待时间,秒-
└─maxFailsint32最大失败次数-
└─maxConnsint32最大连接数-
└─statusstring状态策略 'none':无(默认) 'down':停用 'backup':备用-

Response-example:

{
	"success":true,
	"status":"id0wta",
	"msg":"f09dys",
	"obj":[
		{
			"id":"45",
			"upstreamId":"45",
			"server":"37yflf",
			"port":78,
			"weight":848,
			"failTimeout":107,
			"maxFails":943,
			"maxConns":174,
			"status":"4ters3"
		}
	]
}

添加或编辑server

URL: http://your_ip:port/api/upstream/insertOrUpdateServer

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 添加或编辑server

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstring主键false-
upstreamIdstring负载均衡upstream的idtrue-
serverstring负载节点ip (例:10.10.10.1)true-
portint32负载节点端口 (例:8080)true-
weightint32负载节点权重false-
failTimeoutint32失败等待时间,秒false-
maxFailsint32最大失败次数false-
maxConnsint32最大连接数false-
statusstring状态策略 'none':无(默认) 'down':停用 'backup':备用false-

Request-example:

curl   -i http://your_ip:port/api/upstream/insertOrUpdateServer?upstreamId=45&createTime=1641871596310&maxConns=830&id=45&weight=735&status=briecg&port=391&updateTime=1641871596310&failTimeout=538&maxFails=420&server=glqt6c&monitorStatus=608

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"hm8psm",
	"msg":"shliao",
	"obj":{
		"waring":"You may have used non-display generics."
	}
}