示例:与VSX对等开关进行交互
在以下示例中,启用了虚拟开关扩展名(VSX),主VSX开关IP地址为192.0.2.5,辅助VSX开关IP地址为192.0.2.6。
在IP地址192.0.2.5上获取连接开关上所有VLAN的列表:
示例方法和URI:
获取“ https://192.0.2.5/rest/v1/系统/vlans”
示例卷曲命令:
$curl -noproxy 192.0.2.5 -K get \ -b/tmp/primary_auth_cookie \“ https://192.0.2.5/rest/v1/系统/vlans”
获取对等VSX开关上所有VLAN的列表:
示例方法和URI:
获取“ https://192.0.2.5/vsx-peer/rest/v1/系统/vlans”
示例卷曲命令:
$curl -noproxy 192.0.2.5 -k get \ -b/tmp/primary_auth_cookie \“ https://192.0.2.5/vsx-peer/rest/v1/系统/vlans”
在IP地址连接到主VSX开关时,获取次级VSX开关的VSX状态192.0.2.5:
示例方法和URI:
获取“ https://192.0.2.5/vsx-peer/rest/v1/system/vsx?属性?oper_status”
示例卷曲命令:
$curl -noproxy 192.0.2.5 -k get \ -b/tmp/primary_auth_cookie \“ https://192.0.2.5/vsx-peer/rest/v1/system/vsx?属性?oper_status”
您还可以在连接到辅助VSX开关时获得主VSX开关的VSX状态。