CSR1000V와 Postman에서 REST-API
공식은 이 근처.
설정
API 참조
IOS-version
CSR-1#show flash: | i .pkg
17 289154944 Jan 31 2017 23:05:47 +00:00 /bootflash/csr1000v-mono-universalk9.03.16.05.S.155-3.S5-ext.SPA.pkg
CSR-1#
CSR-1#show version | i 15
Cisco IOS Software, CSR1000V Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.5(3)S5, RELEASE SOFTWARE (fc2)
설정
나온 당초보다 훨씬 깨끗했습니다.
IOS-config
transport-map type persistent webui https-webui
secure-server
!
username cisco privilege 15 password 0 cisco
!
virtual-service csr_mgmt
ip shared host-interface GigabitEthernet1
activate
!
no ip http server
ip http authentication local
ip http secure-server
!
transport type persistent webui input https-webui
REST-API 서비스 시작 및 옵션 설정.
IOS-rest
CSR-1(config)#remote-management
CSR-1(cfg-remote-mgmt)#?
default Set a command to its defaults
exit exit remote management configuration submode
no Negate a command or set its defaults
pnsc Prime Network Services Controller and Policy Agent configuration
restful-api RESTful API
CSR-1(cfg-remote-mgmt)#rest
CSR-1(cfg-remote-mgmt)#restful-api ?
autosave Automatic configuration saving interval
local-port Local port for secure access to RESTful API
single-session Limit RESTful API to one session at a time
<cr>
확인
IOS-show
CSR-1#show virtual-service detail
Virtual service csr_mgmt detail
State : Activated
Package information
Name : iosxe-remote-mgmt.03.16.05.S.155-3.S5-ext.ova
Path : bootflash:/iosxe-remote-mgmt.03.16.05.S.155-3.S5-ext.ova
Application
Name : csr_mgmt
Installed version : 03.16.04
Description : CSR-MGMT
Signing
Key type : Cisco development key
Method : SHA-1
Licensing
Name : Not Available
Version : Not Available
Detailed guest status
----------------------------------------------------------------------
Process Status Uptime # of restarts
----------------------------------------------------------------------
nginx UP 0Y 0W 0D 1: 2: 2 0
climgr UP 0Y 0W 0D 1: 2: 2 0
restful_api UP 0Y 0W 0D 1: 2: 2 0
fcgicpa Down
pnscag Down
pnscdme Down
----------------------------------------------------------------------
Feature Status Configuration
----------------------------------------------------------------------
Restful API Disabled, UP
PNSC Disabled, Down
Network stats:
eth0: RX packets:1868, TX packets:6
eth1: RX packets:185, TX packets:139
Coredump file(s): lost+found
Activated profile name: None
Resource reservation
Disk : 756 MB
Memory : 512 MB
CPU : 5% system CPU
Attached devices
Type Name Alias
---------------------------------------------
NIC ieobc_1 ieobc
NIC dp_1_33 net2
Disk _rootfs
Disk /opt/var
Disk /opt/va...
Serial/shell serial0
Serial/aux serial1
Serial/Syslog serial2
Serial/Trace serial3
Watchdog watchdo...
Network interfaces
MAC address Attached to interface
------------------------------------------------------
54:0E:00:0B:0C:02 ieobc_1
00:50:56:A2:22:D3 VirtualPortGroup33
Guest interface
---
Interface: eth1
ip address: 10.71.130.57/21
---
Guest routes
---
Address/Mask Next Hop Intf.
-------------------------------------------------------------------------------
---
Resource admission (without profile) : passed
Disk space : 756MB
Memory : 512MB
CPU : 5% system CPU
VCPUs : Not specified
POSTMAN에서 토큰 획득
이제 실행하면 다음과 같이 token-id가 반환됩니다. 이후에는 이것을 X-Auth-Token으로 헤더에 넣으면 읽기/쓰기에 액세스할 수 있습니다.
POSTMAN에서 인터페이스 정보를 얻는 예
이상입니다.
Reference
이 문제에 관하여(CSR1000V와 Postman에서 REST-API), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kikuta2055/items/0e9e28fa85ff08c883c3텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)