已经找到“” 的记录295条
查询可用区关联操作系统信息

简要描述:

  • 本接口用于查询可用区关联操作系统信息。接口请求地址

参数:

参数名 必选 类型 说明
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数据结构说明
  • group_list数据结构说明
参数名 类型 说明
RequestId string 请求编号
Code integer 返回编号
Message string 返回内容
Name string 操作系统类别名称
Attribute integer 操作系统类型属性 1:静态 2:动态
Status integer 状态 0:禁用 1:启用
  • system_list数据结构说明
参数名 类型 说明
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:重装
  • detail数据结构说明
参数名 类型 说明
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:启用

备注

查询可用区关联规格信息

简要描述:

  • 本接口用于查询可用区关联规格信息。接口请求地址

注:

  • 当请求参数 line_no 和 area_no 同时存在,area_no 必须为 line_no 所属线路下的 可用区编号。

参数:

参数名 必选 类型 说明
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数据结构说明
  • group_list数据结构说明
参数名 类型 说明
Name string 规格组名称
Group_id string 规格组编号
  • spec_list数据结构说明
参数名 类型 说明
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 升级状态
  • detail数据结构说明
参数名 类型 说明
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

备注

查询拨号VPS宿主机列表

简要描述:

  • 本接口仅适用于获取产品类型为拨号VPS的宿主机列表

参数:

参数名 必选 类型 说明
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 格式,您可以指定公共请求参数 Format 变更返回结果的格式。更多详情,请参阅 公共参数。为了便于查看和美观,API 文档返回示例均有换行和缩进等处理,实际返回结果无换行和缩进处理。

正常返回示例:

  • 接口调用成功后会返回接口返回参数和请求 ID,我们称这样的返回为正常返回。HTTP 状态码为 2xx。

JSON示例

 

  {
    "RequestId":"4C467B38-3910-447D-87BC-AC049166F216",
    "Code" : "200"
  }

 

异常返回示例:

  • 接口调用出错后,会返回错误码、错误信息和请求 ID,我们称这样的返回为异常返回。HTTP 状态码为 4xx 或者 5xx。

您可以根据接口错误码,参考 公共错误码 以及 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连接代理ip(账密模式)

此示例Python使用Selenium调用Chrome浏览器并通过代理进行自动化测试。

  • 代码示例
  1. import time
  2. import string
  3. import zipfile
  4. from selenium import webdriver
  5. from selenium.webdriver.chrome.service import Service
  6. targetURL = "http://myip.ipip.net" # 访问的目标站点
  7. proxyHost = "61.171.76.145" # 代理IP地址
  8. proxyPort = "50353" # 代理IP端口号
  9. authKey = "x" # 代理IP的AuthKey
  10. password = "x" # 代理IP的AuthPwd
  11. def create_proxy_auth_extension(proxy_host, proxy_port, proxy_username, proxy_password, scheme='http',
  12. plugin_path=None):
  13. if plugin_path is None:
  14. plugin_path = r'./{}_{}_qgnet_proxyauth_plugin.zip'.format(proxy_username, proxy_password)
  15. manifest_json = """
  16. {
  17. "version": "1.0.0",
  18. "manifest_version": 2,
  19. "name": "Chrome Proxy",
  20. "permissions": [
  21. "proxy",
  22. "tabs",
  23. "unlimitedStorage",
  24. "storage",
  25. "",
  26. "webRequest",
  27. "webRequestBlocking"
  28. ],
  29. "background": {
  30. "scripts": ["background.js"]
  31. },
  32. "minimum_chrome_version":"22.0.0"
  33. }
  34. """
  35. background_js = string.Template(
  36. """
  37. var config = {
  38. mode: "fixed_servers",
  39. rules: {
  40. singleProxy: {
  41. scheme: "${scheme}",
  42. host: "${host}",
  43. port: parseInt(${port})
  44. },
  45. bypassList: ["localhost"]
  46. }
  47. };
  48. chrome.proxy.settings.set({value: config, scope: "regular"}, function() {});
  49. function callbackFn(details) {
  50. return {
  51. authCredentials: {
  52. username: "${username}",
  53. password: "${password}"
  54. }
  55. };
  56. }
  57. chrome.webRequest.onAuthRequired.addListener(
  58. callbackFn,
  59. {urls: [""]},
  60. ['blocking']
  61. );
  62. """
  63. ).substitute(
  64. host=proxy_host,
  65. port=proxy_port,
  66. username=proxy_username,
  67. password=proxy_password,
  68. scheme=scheme,
  69. )
  70. with zipfile.ZipFile(plugin_path, 'w') as zp:
  71. zp.writestr("manifest.json", manifest_json)
  72. zp.writestr("background.js", background_js)
  73. return plugin_path
  74. if __name__ == '__main__':
  75. # 此处指定您的webdriver路径,版本需要跟您所使用的Chrome版本一致,
  76. # 下载地址https://registry.npmmirror.com/binary.html?path=chromedriver/
  77. driver_location = "./chromedriver/chromedriver_v106_win.exe"
  78. proxy_auth_plugin_path = create_proxy_auth_extension(
  79. proxy_host=proxyHost,
  80. proxy_port=proxyPort,
  81. proxy_username=authKey,
  82. proxy_password=password)
  83. option = webdriver.ChromeOptions()
  84. option.add_argument("--start-maximized") # 窗口最大化运行
  85. option.add_extension(proxy_auth_plugin_path) # 添加proxy插件
  86. # 此处selenium版本为4.8.0
  87. driver = webdriver.Chrome(service=Service(driver_location), options=option)
  88. driver.get(targetURL)
  89. time.sleep(100)
  90. driver.quit()
  • 运行结果
Python自动化测试Selenium+chrome连接代理ip(白名单模式)

此示例Python使用Selenium调用Chrome浏览器并通过代理进行自动化测试。

  • 代码示例
  1. from selenium import webdriver
  2. from selenium.webdriver.chrome.service import Service
  3. targetURL = "http://myip.ipip.net" #访问的目标站点
  4. proxyAddr = "您的代理IP:端口号"
  5. if __name__ == '__main__':
  6. browser_location = r".\Chrome\chrome.exe" #指定浏览器路径位置
  7. driver_location = r".\Chrome\chromedriver.exe" #指定Driver路径位置
  8. option = webdriver.ChromeOptions()
  9. option.binary_location = browser_location #设置浏览器位置
  10. option.add_argument("--start-maximized") #窗口最大化运行
  11. option.add_argument('--proxy-server=%(server)s' % {"server": proxyAddr})
  12. driver = webdriver.Chrome(service=Service(driver_location), options=option)
  13. driver.get(targetURL)
  14. print(driver.page_source)
  • 运行结果

隧道代理(固定时长)python语言代码示例
  1. import base64
  2. import time
  3. import requests
  4. from requests.adapters import HTTPAdapter
  5. auth_key = "请改成您的Key"
  6. password = "请改成您的AuthPwd"
  7. tunnel_server = "http://请改成您的隧道地址" # 如:tunnel3.qg.net:19263
  8. target_url = "https://ip.cn/api/index?ip=&type=0" # 要访问的目标地址
  9. proxy_headers = {}
  10. proxy = {
  11. "http": tunnel_server,
  12. "https": tunnel_server
  13. }
  14. def encode_authorization(key, passwd):
  15. # python 使用 bytes 类型进行 base64 编码
  16. basic_str = bytes("%s:%s" % (key, passwd), "ascii")
  17. # 得到的返回值也是 bytes 类型,所以需要再 decode 为字符串
  18. return "Basic %s" % base64.b64encode(basic_str).decode("utf-8")
  19. def reset_tunnel_proxy_headers():
  20. global proxy_headers
  21. proxy_headers = {
  22. tunnel_server: {
  23. "Proxy-Authorization": encode_authorization(auth_key, password)
  24. }
  25. }
  26. def update_tunnel_proxy_headers(key, val):
  27. global proxy_headers
  28. proxy_headers[tunnel_server][key] = val
  29. def new_session():
  30. adapter = TunnelProxyAdapter()
  31. se = requests.Session()
  32. se.mount('https://', adapter)
  33. se.mount('http://', adapter)
  34. return se
  35. class TunnelProxyAdapter(requests.adapters.HTTPAdapter):
  36. def proxy_headers(self, p):
  37. if p in proxy_headers:
  38. print("session with headers:", proxy_headers[p])
  39. return proxy_headers[p]
  40. else:
  41. return None
  42. def multi_channel_tunnel():
  43. """
  44. 结果类似:
  45. request on multi channel
  46. request id: 1 , channel id: channel-1, code: 200, result: 183.155.88.224
  47. request id: 2 , channel id: channel-2, code: 200, result: 125.112.38.153
  48. request id: 3 , channel id: channel-3, code: 200, result: 183.155.89.125
  49. request id: 4 , channel id: channel-4, code: 200, result: 49.71.121.169
  50. request id: 5 , channel id: channel-5, code: 200, result: 115.210.67.220
  51. request id: 6 , channel id: channel-6, code: 200, result: 36.25.41.178
  52. request id: 7 , channel id: channel-7, code: 200, result: 180.125.162.116
  53. request id: 8 , channel id: channel-8, code: 200, result: 140.250.150.158
  54. request id: 9 , channel id: channel-9, code: 200, result: 121.227.102.227
  55. request id: 10, channel id: channel-10, code: 200, result: 49.88.106.198
  56. request id: 1 , channel id: channel-1, code: 200, result: 183.155.88.224
  57. request id: 2 , channel id: channel-2, code: 200, result: 125.112.38.153
  58. request id: 3 , channel id: channel-3, code: 200, result: 183.155.89.125
  59. request id: 4 , channel id: channel-4, code: 200, result: 49.71.121.169
  60. request id: 5 , channel id: channel-5, code: 200, result: 115.210.67.220
  61. request id: 6 , channel id: channel-6, code: 200, result: 36.25.41.178
  62. request id: 7 , channel id: channel-7, code: 200, result: 180.125.162.116
  63. request id: 8 , channel id: channel-8, code: 200, result: 140.250.150.158
  64. request id: 9 , channel id: channel-9, code: 200, result: 121.227.102.227
  65. request id: 10, channel id: channel-10, code: 200, result: 49.88.106.198
  66. """
  67. print("request on multi channel")
  68. reset_tunnel_proxy_headers()
  69. for i in range(1, 11):
  70. se = new_session()
  71. chan_id = "channel-%s" % i
  72. update_tunnel_proxy_headers("Proxy-TunnelID", chan_id)
  73. resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
  74. print("request id: %-2s, channel id: %s, code: %s, result: %s" % (i, chan_id, resp.status_code, resp.text))
  75. time.sleep(10)
  76. # 因为固定时长为1分钟,所以在1分钟内继续使用已有通道,仍是之前的IP
  77. for i in range(1, 11):
  78. se = new_session()
  79. chan_id = "channel-%s" % i
  80. update_tunnel_proxy_headers("Proxy-TunnelID", chan_id)
  81. resp = se.get(target_url, proxies=proxy, headers={"Connection": "close"})
  82. print("request id: %-2s, channel id: %s, code: %s, result: %s" % (i, chan_id, resp.status_code, resp.text))
  83. if __name__ == "__main__":
  84. multi_channel_tunnel()

客户热线:4007-567-365

客户服务中心
点击联系微信客服