简要描述:
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
productId | 是 | integer | 品牌编号 |
line_no | 否 | string | 线路编号 |
area_no | 否 | string | 可用区编号 |
type | 否 | integer | 返回值类别取值范围:1:全部;2:系统类别;3:系统信息 |
detail | 否 | integer | 可用区关联系统,默认值:1取值范围:1:输出;2:不输出 |
输入示例
https://www.fwvps.com/api/cloud-product/areaSystem?productId=value&type=1
返回示例
JSON格式
{
"RequestId":'423369C7-AD6F-3GT6-NMJ7-E2RG5N6HG7D3',
"Code": 0,
"Message" : "返回内容"
"Data": {
"group_list":{
"1":{
"Name": "windows",
"Attribute": "1",
"Status": "1",
},
"2":{
"Name": "linux",
"Attribute": "1",
"Status": "1",
}
},
"system_list":{
"1":{
"Line_no":"",
"Group_name":"windows",
"Name": "windows 2008",
"System_no": "img-asdsaewf",
"Iogin_name": "administrator",
"Port": "",
"Max_cpu_limit": "",
"Cpu_limit": "",
"Max_memory_limit": "",
"Memory_limit": "",
"Status":"1",
"Type":"",
},
"2":{
"Line_no":"",
"Group_name":"windows",
"Name": "windows 2012",
"System_no": "img-sdfdfv",
"Iogin_name": "administrator",
"Port": "",
"Max_cpu_limit": "",
"Cpu_limit": "",
"Max_memory_limit": "",
"Memory_limit": "",
"Status":"1",
"Type":"create",
}
},
"detail":{
"1":{
"Line_no":"ap-guangzhou",
"Area_no": "ap-guangzhou-1",
"Group_name": "Windows",
"Name": "windows 2008",
"System_no": "img-xxxx",
"Max_memory_limit" : "",
"Memory_limit":"",
"Max_cpu_limit":"",
"Cpu_limit":"",
"Type":"",
"Attribute":"",
"Status":"1"
},
"2":{
"Line_no":"ap-guangzhou",
"Area_no": "ap-guangzhou-1",
"Group_name": "Windows",
"Name": "windows 2012",
"System_no": "img-xxxx",
"Max_memory_limit" : "",
"Memory_limit":"",
"Max_cpu_limit":"",
"Cpu_limit":"",
"Type":"",
"Attribute":"",
"Status":"1"
},
}
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 状态码 |
Message | string | 返回内容 |
group_list | array | 系统分类列表,详情请参考group_list数据结构说明 |
system_list | array | 系统信息列表,详情请参考system_list数据结构说明 |
detail | array | 可用区关联系统列表,详情请参考detail数据结构说明 |
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 返回编号 |
Message | string | 返回内容 |
Name | string | 操作系统类别名称 |
Attribute | integer | 操作系统类型属性 1:静态 2:动态 |
Status | integer | 状态 0:禁用 1:启用 |
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 返回编号 |
Message | string | 返回内容 |
Line_no | string | 线路编号 |
Group_name | string | 镜像类别 |
Name | string | 操作系统名称 |
System_no | string | 操作系统编号 |
Login_name | string | 登录名 |
Port | string | 端口 |
Max_cpu_limit | integer | 最大cpu限制 |
Max_memory_limit | integer | 最大内存限制 |
Memory_limit | integer | 最小内存限制 |
Status | integer | 启用状态,0:禁用;1:启用 |
Type | string | 支持类型,create:创建;install:重装 |
参数名 | 类型 | 说明 |
---|---|---|
Line_no | string | 线路编号 |
Area_no | string | 可用区编号 |
Group_name | string | 镜像类别 |
Name | string | 镜像名称 |
System_no | string | 镜像编号 |
Max_memory_limit | string | 内存最大限制值 |
Memory_limit | string | 内存最小限制 |
Max_cpu_limit | string | CPU最大限制 |
Cpu_limit | string | CPU最小限制 |
Attribute | integer | 操作系统类型属性 1:静态 2:动态 |
Type | string | 操作类型类型:开通create,重装install |
Status | integer | 启用状态,0:禁用;1:启用 |
备注
简要描述:
注:
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
productId | 是 | integer | 品牌编号 |
line_no | 否 | string | 线路编号 |
area_no | 否 | string | 可用区编号 |
type | 否 | integer | 返回值类别取值范围:1:全部;2:规格组;3:规格信息 |
detail | 否 | integer | 可用区关联规格,默认值:1取值范围:1:输出;2:不输出 |
输入示例
https://www.fwvps.com/api/cloud-product/areaSpec?productId=104&type=1
返回示例
JSON格式
{
"RequestId":'423369C7-AD6F-3GT6-NMJ7-E2RG5N6HG7D3',
"Code": 0,
"Message" : "返回内容"
"Data": {
"group_list":{
"1":{
"Name": "标准型S1",
"Group_id":"D1"
},
"2":{
"Name": "标准型S2",
"Group_id":"D2"
}
},
"spec_list":{
"1":{
"Group_id":"S2",
"Name": "标准型S2",
"Spec_no": "S2.SMALL1",
"Cpu":"1",
"Memory":"1",
"Systemdisk":"",
"Datadisk":"",
"Bandwidth":"",
"Ip":"",
"Defense":"",
"Months":"",
"Months_rate":"",
"Buy_status":"1",
"Upgrade_status":"1",
},
"2":{
"Group_id":"S2",
"Name": "标准型S2",
"Spec_no": "S2.SMALL2",
"Cpu":"1",
"Memory":"2",
"Systemdisk":"",
"Datadisk":"",
"Bandwidth":"",
"Ip":"",
"Defense":"",
"Months":"",
"Months_rate":"",
"Buy_status":"1",
"Upgrade_status":"1",
}
}
"detail":{
"1":{
"Line_no":"ap-beijing",
"Area_no":"ap-beijing-1",
"Group_name":"标准型S1",
"Group_id":"S1",
"Spec_name":"标准型S1",
"Spec_no":"S1.SMALL2",
"Price":""
"Cpu" : "1",
"Memory": "2",
"Trial_time":"",
"Day_rate":"",
"Week_rate":"",
"Months":"",
"Months_rate":"",
"Buy_status":1,
"Status":1,
"Upgrade_status":"",
},
"2":{
"Line_no":"ap-beijing",
"Area_no":"ap-beijing-1",
"Group_name":"标准型S1",
"Group_id":"S1",
"Spec_name":"标准型S1",
"Spec_no":"S1.MEDIUM2",
"Price":""
"Cpu" : "2",
"Memory": "2",
"Trial_time":"",
"Day_rate":"",
"Week_rate":"",
"Months":"",
"Months_rate":"",
"Buy_status":1,
"Status":1,
"Upgrade_status":"",
}
}
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 状态码 |
Message | string | 返回内容 |
group_list | array | 规格组列表,详情请参考group_list数据结构说明 |
spec_list | array | 规格信息列表,详情请参考spec_list数据结构说明 |
detail | array | 可用区关联规格列表,详情请参考detail数据结构说明 |
参数名 | 类型 | 说明 |
---|---|---|
Name | string | 规格组名称 |
Group_id | string | 规格组编号 |
参数名 | 类型 | 说明 |
---|---|---|
Group_id | string | 规格组编号 |
Name | string | 规格名称 |
Spec_no | string | 规格编号 |
Cpu | integer | cpu |
Memory | decimal | 内存 |
Systemdisk | int | 系统盘 |
Datadisk | integer | 数据盘 |
Bandwidth | integer | 带宽 |
Ip | integer | ip数 |
Defense | integer | 防御值 |
Buy_status | integer | 购买状态 |
Upgrade_status | integer | 升级状态 |
参数名 | 类型 | 说明 |
---|---|---|
Line_no | string | 线路编号 |
Area_no | string | 可用区编号 |
Group_name | string | 规格组名称 |
Group_id | string | 规格组编号 |
Spec_name | string | 规格名称 |
Spec_no | string | 规格编号 |
Price | string | 销售价格 |
Cpu | integer | cpu |
Memory | decimal | 内存 |
Trial_time | string | 试用时间 |
Day_rate | string | 日付费率 |
Week_rate | string | 周付费率 |
Months | string | 可选时长 例如:1,3,6,12,24,36 |
Months_rate | string | 月付费率 例如:1,3,6,12,24,36 |
Buy_status | integer | 购买状态 1:开启 0:关闭 |
Upgrade_status | integer | 升级状态 1:开启 0:关闭 |
Status | integer | 规格状态 1:开启 0:关闭 |
备注
简要描述:
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
productId | 是 | integer | 品牌编号 |
line_no | 否 | string | 线路编号 |
输入示例
https://www.fwvps.com/api/cloud-product/areaList?type_id=1&productId=1
返回示例
{
"RequestId":'423369C7-AD6F-3GT6-NMJ7-E2RG5N6HG7D3',
"Code": 0,
"Message" : "返回内容"
"Data": {
"1":{
"Name": "泰国一区",
"Area_no": "ap-bangkok-1",
"Line_no": "ap-bangkok",
"Status":1,
},
"2":{
"Super_id": "1",
"Name": "泰国二区",
"Area_no": "ap-bangkok-2",
"Status":0,
}
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 状态码 |
Message | string | 返回内容 |
Name | string | 可用区名称 |
Area_no | string | 可用区编号 |
Line_no | integer | 线路编号 |
Status | integer | 可用区状态 1:启用 0:禁用 |
备注
简要描述:
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
productId | 是 | integer | 品牌编号 |
输入示例
https://www.fwvps.com/api/cloud-product/lineList?productId=104
返回示例
JSON格式
{
"RequestId":'423369C7-AD6F-3GT6-NMJ7-E2RG5N6HG7D3',
"Code": 0,
"Message" : "返回内容"
"Data": {
"1":{
"Name": "'亚太地区(曼谷)",
"Line_no": "ap-bangkok",
"Line_status":1,
"Buy_status":1,
"Grade_status":1,
"Renew_status":1,
"Defense_status":1,
"Install_status":1,
"Ip_type":"",
"Vpc_type":""
},
"2":{
"Name": "华北地区(北京)",
"Line_no": "ap-beijing",
"Line_status":1,
"Buy_status":1,
"Grade_status":1,
"Renew_status":1,
"Defense_status":1,
"Install_status":1,
"Ip_type":"",
"Vpc_type":""
}
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 状态码 |
Message | string | 返回内容 |
Line_no | string | 线路编号 |
Name | string | 线路名称 |
Line_status | integer | 线路状态 1:启用 0:禁用 |
Buy_status | integer | 购买状态 1:启用 0:禁用 |
Grade_status | integer | 升级状态 1:启用 0:禁用 |
Renew_status | integer | 续费状态 1:启用 0:禁用 |
Defense_status | integer | 防御状态 1:启用 0:禁用 |
Install_status | integer | 重装状态 1:liunx与windows允许互装 2:禁止互装 |
Ip_type | string | 弹性公网IP的类型 5_bgp:全动态BGP 5_sbgp:静态BGP |
Vpc_type | string | vpc类型 19_bgp:全动态BGP 19_sbgp:静态BGP |
备注
简要描述:
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
productId | 是 | integer | 品牌编号 |
package_no | 是 | varchar | 套餐编号 |
输入示例
https://www.fwvps.com/api/cloud-product/panel?productId=104&package_no=cqdx-A1
返回示例
JSON格式
{
"RequestId":'423369C7-AD6F-3GT6-NMJ7-E2RG5N6HG7D3',
"Code": 0,
"Message" : "返回内容"
"Data": {
"1":{
"Id": "1253",
"Name": "重庆市-电信1(剩余5台)",
},
"2":{
"Id": "1254",
"Name": "重庆市-电信2(剩余10台)",
}
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 状态码 |
Message | string | 返回内容 |
Id | integer | 宿主机ID |
Name | string | 机房名称及剩余数量 |
备注
正常返回示例:
JSON示例
{
"RequestId":"4C467B38-3910-447D-87BC-AC049166F216",
"Code" : "200"
}
异常返回示例:
您可以根据接口错误码,参考 公共错误码 以及 API 错误中心 排查错误。当您无法排查错误时,可以 提交工单 联系我们,并在工单中注明 RequestId。
JSON示例
{
"RequestId": "4C467B38-3910-447D-87BC-AC049166F216",
"Code" : "-2"
"Message":"xxxxxxx"
}
备注
简要描述:
本接口用于查询品牌列表。接口请求地址
输入示例
https://www.fwvps.com/api/common/brandlist
返回示例
JSON格式
{
"RequestId":'423369C7-AD6F-3GT6-NMJ7-E2RG5N6HG7D3',
"Code": 200,
"Data": {
"1":{
"Id": "'100",
"Other_name":"阿里云"
},
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
RequestId | string | 请求编号 |
Code | integer | 状态码 |
Id | integer | 品牌编号 |
Other_name | string | 品牌名称 |
备注
此示例Python使用Selenium调用Chrome浏览器并通过代理进行自动化测试。
import time
import string
import zipfile
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
targetURL = "http://myip.ipip.net" # 访问的目标站点
proxyHost = "61.171.76.145" # 代理IP地址
proxyPort = "50353" # 代理IP端口号
authKey = "x" # 代理IP的AuthKey
password = "x" # 代理IP的AuthPwd
def create_proxy_auth_extension(proxy_host, proxy_port, proxy_username, proxy_password, scheme='http',
plugin_path=None):
if plugin_path is None:
plugin_path = r'./{}_{}_qgnet_proxyauth_plugin.zip'.format(proxy_username, proxy_password)
manifest_json = """
{
"version": "1.0.0",
"manifest_version": 2,
"name": "Chrome Proxy",
"permissions": [
"proxy",
"tabs",
"unlimitedStorage",
"storage",
"",
"webRequest",
"webRequestBlocking"
],
"background": {
"scripts": ["background.js"]
},
"minimum_chrome_version":"22.0.0"
}
"""
background_js = string.Template(
"""
var config = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "${scheme}",
host: "${host}",
port: parseInt(${port})
},
bypassList: ["localhost"]
}
};
chrome.proxy.settings.set({value: config, scope: "regular"}, function() {});
function callbackFn(details) {
return {
authCredentials: {
username: "${username}",
password: "${password}"
}
};
}
chrome.webRequest.onAuthRequired.addListener(
callbackFn,
{urls: [""]},
['blocking']
);
"""
).substitute(
host=proxy_host,
port=proxy_port,
username=proxy_username,
password=proxy_password,
scheme=scheme,
)
with zipfile.ZipFile(plugin_path, 'w') as zp:
zp.writestr("manifest.json", manifest_json)
zp.writestr("background.js", background_js)
return plugin_path
if __name__ == '__main__':
# 此处指定您的webdriver路径,版本需要跟您所使用的Chrome版本一致,
# 下载地址https://registry.npmmirror.com/binary.html?path=chromedriver/
driver_location = "./chromedriver/chromedriver_v106_win.exe"
proxy_auth_plugin_path = create_proxy_auth_extension(
proxy_host=proxyHost,
proxy_port=proxyPort,
proxy_username=authKey,
proxy_password=password)
option = webdriver.ChromeOptions()
option.add_argument("--start-maximized") # 窗口最大化运行
option.add_extension(proxy_auth_plugin_path) # 添加proxy插件
# 此处selenium版本为4.8.0
driver = webdriver.Chrome(service=Service(driver_location), options=option)
driver.get(targetURL)
time.sleep(100)
driver.quit()
此示例Python使用Selenium调用Chrome浏览器并通过代理进行自动化测试。
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
targetURL = "http://myip.ipip.net" #访问的目标站点
proxyAddr = "您的代理IP:端口号"
if __name__ == '__main__':
browser_location = r".\Chrome\chrome.exe" #指定浏览器路径位置
driver_location = r".\Chrome\chromedriver.exe" #指定Driver路径位置
option = webdriver.ChromeOptions()
option.binary_location = browser_location #设置浏览器位置
option.add_argument("--start-maximized") #窗口最大化运行
option.add_argument('--proxy-server=%(server)s' % {"server": proxyAddr})
driver = webdriver.Chrome(service=Service(driver_location), options=option)
driver.get(targetURL)
print(driver.page_source)
import base64
import time
import requests
from requests.adapters import HTTPAdapter
auth_key = "请改成您的Key"
password = "请改成您的AuthPwd"
tunnel_server = "http://请改成您的隧道地址" # 如:tunnel3.qg.net:19263
target_url = "https://ip.cn/api/index?ip=&type=0" # 要访问的目标地址
proxy_headers = {}
proxy = {
"http": tunnel_server,
"https": tunnel_server
}
def encode_authorization(key, passwd):
# python 使用 bytes 类型进行 base64 编码
basic_str = bytes("%s:%s" % (key, passwd), "ascii")
# 得到的返回值也是 bytes 类型,所以需要再 decode 为字符串
return "Basic %s" % base64.b64encode(basic_str).decode("utf-8")
def reset_tunnel_proxy_headers():
global proxy_headers
proxy_headers = {
tunnel_server: {
"Proxy-Authorization": encode_authorization(auth_key, password)
}
}
def update_tunnel_proxy_headers(key, val):
global proxy_headers
proxy_headers[tunnel_server][key] = val
def new_session():
adapter = TunnelProxyAdapter()
se = requests.Session()
se.mount('https://', adapter)
se.mount('http://', adapter)
return se
class TunnelProxyAdapter(requests.adapters.HTTPAdapter):
def proxy_headers(self, p):
if p in proxy_headers:
print("session with headers:", proxy_headers[p])
return proxy_headers[p]
else:
return None
def multi_channel_tunnel():
"""
结果类似:
request on multi channel
request id: 1 , channel id: channel-1, code: 200, result: 183.155.88.224
request id: 2 , channel id: channel-2, code: 200, result: 125.112.38.153
request id: 3 , channel id: channel-3, code: 200, result: 183.155.89.125
request id: 4 , channel id: channel-4, code: 200, result: 49.71.121.169
request id: 5 , channel id: channel-5, code: 200, result: 115.210.67.220
request id: 6 , channel id: channel-6, code: 200, result: 36.25.41.178
request id: 7 , channel id: channel-7, code: 200, result: 180.125.162.116
request id: 8 , channel id: channel-8, code: 200, result: 140.250.150.158
request id: 9 , channel id: channel-9, code: 200, result: 121.227.102.227
request id: 10, channel id: channel-10, code: 200, result: 49.88.106.198
request id: 1 , channel id: channel-1, code: 200, result: 183.155.88.224
request id: 2 , channel id: channel-2, code: 200, result: 125.112.38.153
request id: 3 , channel id: channel-3, code: 200, result: 183.155.89.125
request id: 4 , channel id: channel-4, code: 200, result: 49.71.121.169
request id: 5 , channel id: channel-5, code: 200, result: 115.210.67.220
request id: 6 , channel id: channel-6, code: 200, result: 36.25.41.178
request id: 7 , channel id: channel-7, code: 200, result: 180.125.162.116
request id: 8 , channel id: channel-8, code: 200, result: 140.250.150.158
request id: 9 , channel id: channel-9, code: 200, result: 121.227.102.227
request id: 10, channel id: channel-10, code: 200, result: 49.88.106.198
"""
print("request on multi channel")
reset_tunnel_proxy_headers()
for i in range(1, 11):
se = new_session()
chan_id = "channel-%s" % i
update_tunnel_proxy_headers("Proxy-TunnelID", chan_id)
resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
print("request id: %-2s, channel id: %s, code: %s, result: %s" % (i, chan_id, resp.status_code, resp.text))
time.sleep(10)
# 因为固定时长为1分钟,所以在1分钟内继续使用已有通道,仍是之前的IP
for i in range(1, 11):
se = new_session()
chan_id = "channel-%s" % i
update_tunnel_proxy_headers("Proxy-TunnelID", chan_id)
resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
print("request id: %-2s, channel id: %s, code: %s, result: %s" % (i, chan_id, resp.status_code, resp.text))
if __name__ == "__main__":
multi_channel_tunnel()