简单的icontrol测试

来源:互联网 发布:库里2.5孙悟空淘宝 编辑:程序博客网 时间:2024/05/01 07:38

根据OKnet icontrol 入门资料和基础代码来进行测试

参考:http://www.adntech.org/bbs/viewthread.php?tid=2213&extra=page%3D1

 

测试一:获取F5的版本

1)构造XML:SOAP请求,保存为soapreq_get_version.txt

2)使用curl 工具发送查询请求

curl --data-binary @soapreq_get_version.txt https://admin:admin@192.168.1.245/iControl/iControlPortal.cgi --insecure

3)返回的结果如下:

<E:Envelope
        xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:y="http://www.w3.org/2001/XMLSchema"
        xmlns:iControl="urn:iControl"
        E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<E:Body>
<m:get_versionResponse
        xmlns:m="urn:iControl:System/SystemInfo">
<return
        s:type="y:string">BIG-IP_v9.4.7</return>
</m:get_versionResponse>
</E:Body>
</E:Envelope>

 

测试二:通过PHP,使用cURL函数接口,通过HTTP POST XML:SOAP方式,实现调用。

 

1)在php.ini中打开extension=php_curl.dll选项

2)构造HTTP POST XML:SOAP的PHP页面内容,这里的重点是生成的http header 必要要以SOAP ACTION方式才能满足。

 3)这样访问该PHP页面就能得到F5的版本 BIG-IP_v9.4.7

 

测试三:获取F5的系统信息

1)查找icontrol的SDK,API Reference-WSDL-System-SystemInfo,得到F5的系统信息的参数是"get_system_information"

<operation name="get_system_information"> 

 <documentation>Gets the system-identifying attributes of the operating system.</documentation>

  <soap:operation soapAction="urn:iControl:System/SystemInfo" />

2)可以查到systeminformation返回的内容包含system_name,host_name 等等

<xsd:complexType name="System.SystemInformation">

 

 

- <xsd:sequence>
  <xsd:element name="system_name" type="xsd:string" />
  <xsd:element name="host_name" type="xsd:string" />
  <xsd:element name="os_release" type="xsd:string" />
  <xsd:element name="os_machine" type="xsd:string" />
  <xsd:element name="os_version" type="xsd:string" />
  <xsd:element name="platform" type="xsd:string" />
  <xsd:element name="product_category" type="xsd:string" />
  <xsd:element name="chassis_serial" type="xsd:string" />
  <xsd:element name="switch_board_serial" type="xsd:string" />
  <xsd:element name="switch_board_part_revision" type="xsd:string" />
  <xsd:element name="host_board_serial" type="xsd:string" />
  <xsd:element name="host_board_part_revision" type="xsd:string" />
  <xsd:element name="annunciator_board_serial" type="xsd:string" />
  <xsd:element name="annunciator_board_part_revision" type="xsd:string" />
  </xsd:sequence>
  </xsd:complexType>
3)构造包含有XML的PHP代码,如果要单独显示每一个元素的内容,需要查看返回的XML:SOAP的内容,了解元素名称和名称空间,才能对代码进行相应修改,这里的重点是使用simplexml_load_string调用XML:SOAP的结构时需要对调用的XML元素,定义名称空间,具体见代码,只有这样PHP才能正确解析XML:SOAP的内容。
3)显示的内容为F5的主机名:
Hostname :
BIGIP3600.F5.COM

-

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 在天猫买到假美的净水器怎么办 淘宝被恶意投诉怎么办 淘宝被别人举报怎么办 支付宝暂时关闭怎么办 支付宝被投诉怎么办 微店订单退款怎么办 支付宝被骗红包怎么办 顾客退款不退货怎么办 欠供应商的货款怎么办 运营被当作客服怎么办 微信赌球被骗怎么办 微信被骗3000怎么办 手机换屏幕被骗怎么办 考驾照被骗怎么办呀 学车被骗了怎么办 银行卖保险被骗怎么办 卖家违规怎么办扣分 淘宝很久没发货怎么办 淘宝很久不发货怎么办 买家下单就不给发货怎么办 淘宝商家不退货怎么办 退货了不退款怎么办 淘宝客户不退货怎么办 淘宝退款不退怎么办 qq密码记不着了怎么办 退货填错地址怎么办 淘宝店主出门发货怎么办 化妆品囤货太多怎么办 查分网页崩溃怎么办 记事本回车键不能换行怎么办 网页xml 载入失效怎么办 网页没有搜索栏怎么办 咖喱调料打开了怎么办 煮咖喱水放多了怎么办 营业执照4年没用怎么办 刷赞网站打不开怎么办 网页界面变大了怎么办 照片在易企秀放不完整怎么办 易企秀审核未通过怎么办 微信文件过期怎么办 商家一直不退款怎么办