29.04.2019 Views

OS6860(E)_AOS_8.1.1.R01_Switch_Management_Guide

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Web Services REST Examples<br />

Web Services, CLI Scripting, and OpenFlow<br />

CLI Example<br />

The following REST example return the output of the ‘show vlan’ command using the CLI.<br />

Domain<br />

URN<br />

Verb<br />

REST URL<br />

cli<br />

aos<br />

GET<br />

GET https://192.168.1.1/cli/aos?&cmd=show+vlan+5<br />

Example Success Response<br />

JSON<br />

{"result":{<br />

"domain":"cli","cmd":"show<br />

vlan 1",<br />

"diag":200,<br />

"output":"Name :<br />

VLAN-1,\nType :<br />

Static Vlan,\nAdministrative<br />

State : enabled,\nOperational<br />

State : enabled,\nIP Router<br />

Port : enabled,\nIP MTU<br />

: 1500\n",<br />

"error":"<br />

","data":[]}}<br />

XML<br />

<br />

<br />

cli<br />

show vlan 5<br />

200<br />

Name<br />

: VLAN-5,<br />

Type<br />

: Static Vlan,<br />

Administrative State : enabled,<br />

Operational State : enabled,<br />

IP Router Port : enabled,<br />

IP MTU : 1500<br />

<br />

<br />

<br />

<br />

<br />

Example Error Response<br />

JSON<br />

{"result":{<br />

"domain":"show vlan 5",<br />

"diag":400,<br />

"output":"",<br />

"error":": VLAN 342 does not<br />

exist\n",<br />

"data":[]}}<br />

XML<br />

<br />

<br />

mib:vlanTable<br />

400<br />

<br />

Submission failed : VLAN 5 does not exist<br />

<br />

<br />

<br />

<br />

page 10-14 Omni<strong>Switch</strong> <strong>AOS</strong> Release 8 <strong>Switch</strong> <strong>Management</strong> <strong>Guide</strong> May 2014

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!