enable REST API for off-box
Managing Junos Devices Using REST API
https://www.juniper.net/documentation/en_US/junos/topics/example/rest-api-explorer-example.html
CLI Configuration | |
---|---|
set system services rest http ( default port is 3000 ) | |
J-WEB Configuration | |
Basic Restfull API request | |
show commands | |
show security flow session | display xml rpc show rpc commands juniper@SDK-vSRX_JCL_EWF> show security flow session | display xml rpc <rpc-reply xmlns:junos="http://xml.juniper.net/junos/20.1R0/junos"> <rpc> <get-flow-session-information> </get-flow-session-information> </rpc> <cli> <banner></banner> </cli> </rpc-reply> | |
/rpc/get-flow-session-information | |
Security EWF | /rpc/show-web-filtering-status /rpc/show-web-filtering-statistics |
Config rpc comman | |
cmd rpc juniper@SDK-vSRX_JCL_EWF> show configuration security utm utm-policy SDK-Webfilter | display xml <rpc-reply xmlns:junos="http://xml.juniper.net/junos/20.1R0/junos"> <configuration junos:commit-seconds="1605466556" junos:commit-localtime="2020-11-15 18:55:56 UTC" junos:commit-user="juniper"> <security> <utm> <utm-policy> <name>SDK-Webfilter</name> <web-filtering> <http-profile>EVAL-EWF</http-profile> </web-filtering> </utm-policy> </utm> </security> </configuration> <cli> <banner></banner> </cli> </rpc-reply> Extract the config: <configuration><security><utm><utm-policy><name>SDK-Webfilter3</name><web-filtering><http-profile>EVAL-EWF</http-profile></web-filtering></utm-policy></utm></security></configuration> | |
DELETE | |
delete="delete" | <configuration><security><utm><utm-policy delete="delete" ><name>SDK-Webfilter3</name></utm-policy></utm></security></configuration> |
REST-API explorer |