Global Configuration Requirements
Resource Summary for Global Configuration
|
|
|
|
|
|
|
|
|
Banner |
/api/v1/global/banner |
Y |
N |
Y |
N |
Host name |
/api/v1/global/host-name |
Y |
N |
Y |
N |
Domain name |
/api/v1/global/domain-name |
Y |
N |
Y |
N |
Local users |
/api/v1/global/local-users |
Y |
Y |
N |
N |
/api/v1/global/local-users/{username} |
Y |
Y |
Y |
Y |
Logging |
/api/v1/global/logging |
Y |
Y |
N |
N |
/api/v1/global/logging/{ip-address} |
N |
N |
N |
Y |
/api/v1/global/logging/{ip-address}_{transport}_{port} |
Y |
N |
N |
Y |
Global running configuration |
/api/v1/global/running-config |
Y |
N |
Y |
N |
SNMP |
/api/v1/global/snmp |
Y |
Y |
N |
N |
/api/v1/global/snmp/{ip-address} |
Y |
N |
N |
Y |
TACACS |
/api/v1/global/tacacs |
Y |
Y |
N |
N |
/api/v1/global/tacacs/{name} |
Y |
N |
Y |
Y |
Syslog |
/api/v1/global/syslog |
Y |
N |
Y |
N |
Reload |
/api/v1/global/reload |
N |
N |
Y |
N |
Save configuration |
/api/v1/global/save-config |
N |
N |
Y |
N |
Save configuration autosave timer |
/api/v1/global/autosave-timer |
Y |
N |
Y |
N |
IPv6 |
/api/v1/global/ipv6/routing |
Y |
N |
Y |
N |
CLI commands |
/api/v1/global/cli |
N |
N |
Y |
N |
Banner Resource
History
|
|
IOS XE 3.11 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type: “object#banner” |
exec |
string |
Optional |
Exec mode message Providing an empty string cancels the property. |
login |
string |
Optional |
Login message Providing an empty string cancels the property. |
motd |
string |
Optional |
Message of the Day Providing an empty string cancels the property. |
JSON Representation
"kind" : "object#banner",
Resource URI
|
|
GET |
/api/v1/global/banner |
Example
JSON Request
GET /api/v1/global/banner
JSON Response
Content-Type: application/json
Resource URI
|
|
PUT |
/api/v1/global/banner |
Example
JSON Request
PUT /api/v1/global/banner
Content-Type: application/json
JSON Response
Hostname Resource
The hostname resource represents the global configuration hostname property.
History
|
|
IOS XE 3.10 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type. Always “object#hostname” |
host-name |
string |
Mandatory |
router name |
Resource URI
|
|
GET |
/api/v1/global/host-name |
Example
JSON Request
GET /api/v1/global/host-name
JSON Response
Content-Type: application/json
"kind" : "object#host-name",
Resource URI
|
|
PUT |
/api/v1/global/host-name |
Example
JSON Request
PUT /api/v1/global/host-name
Content-Type: application/json
"host-name": "eng-router"
JSON Response
Content-Type: application/json
"host-name": "eng-router"
JSON Response with no Response Body
Domain Name Resource
Represents the domain name property of the global configuration.
History
|
|
IOS XE 3.10 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
|
kind |
string |
Object type. Always “object#domain-name” |
domain-name |
string |
Domain name |
Resource URI
|
|
GET |
/api/v1/global/domain-name |
Example
JSON Request
GET /api/v1/global/domain-name
JSON Response
Content-Type: application/json
"kind": "object#domain-name",
"domain-name": "cisco.com"
Resource URI
|
|
PUT |
/api/v1/global/domain-name |
Example
JSON Request
PUT /api/v1/global/domain-name
Content-Type: application/json
JSON Response
Users Resource
Users resource represents the collection of local users who are allowed to access the device.
History
|
|
IOS XE 3.10 |
Introduced for the CSR1000V platform |
IOS XE 3.11 |
Added pw-type property |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type. Has fixed value “object#local-user” |
username |
string |
Mandatory |
Name of the user. Once created, cannot be modified. |
password |
string |
Optional |
Password. |
privilege |
number |
Optional |
Privilege level 0-15. |
pw-type |
number |
Optional |
IOS password type. Only type 0 and 7 are supported. For a cleartext password, this argument is either 0 or optional. Note : Because only type 0 and 7 are supported, switching from other IOS password types may not be possible. Those credentials may need to be deleted first, and new credentials created. |
JSON Representation
"kind" : "object#local-user"
"password" : "ladf3434d",
Resource URI
|
|
POST |
/api/v1/global/local-users |
Example
JSON Request
POST /api/v1/global/local-users
Content-Type: application/json
JSON Response
Location: http://host/api/v1/global/local-users/jtod
Retrieve User Name or Password
Resource URI
|
|
GET |
/api/v1/global/local-users/{user-name} |
Example
JSON Request
GET /api/v1/global/local-users/cisco
JSON Response
Content-Type: application/json
"kind" : "object#local-user"
"password" : "1adf3434d",
Resource URI
|
|
GET |
/api/v1/global/local-users |
Properties for Retrieve All
|
|
|
kind |
string |
Object type. Has fixed value “collection#local-user” |
users |
string |
Array of user objects. |
Example
JSON Request
GET /api/v1/global/local-users
JSON Response
Content-Type: application/json
"kind": "collection#local-user"
"kind" : "object#local-user",
"kind": "object#local-user",
Resource URI
|
|
PUT |
/api/v1/global/local-users/{user-name} |
Example
JSON Request
PUT /api/v1/global/local-users/cisco
Content-Type: application/json
"password" : "ladf3434d",
JSON Response
Resource URI
|
|
DELETE |
/api/v1/global/local-users/{user-name} |
Example
JSON Request
DELETE /api/v1/global/local-users/marym
JSON Response
Logging Resource
History
|
|
IOS XE 3.11 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type. “object#logging” |
ip-address |
string |
Mandatory |
IP Address of the logging host |
transport |
string |
Optional |
Object type. “object#logging” |
port |
string |
Optional |
port of the logging host |
JSON Representation
"kind" : "object#logging",
"ip-address" : "1.1.1.1",
Example
JSON Request
POST /api/v1/global/logging
Content-Type: application/json
"ip-address": "10.1.1.1",
JSON Response
Location: https://host/api/v1/global/logging/10.1.1.1_tcp_1024
Retrieve a Logging Object
Example
JSON Request
GET /api/v1/global/logging/10.1.1.1
JSON Response
Content-Type: application/json
"kind" : "object#logging",
"ip-address" : "10.1.1.1",
Retrieve All Logging Objects
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type. Always “collection#logging” |
items |
array |
Mandatory |
Array of object#logging |
JSON Representation
"kind" : "collection#logging",
"items" : [ {object#logging} ]
Example
JSON Request
GET /api/v1/global/logging
JSON Response
Content-Type: application/json
"kind" : "collection#logging",
"kind" : "object#logging",
"ip-address" : "10.1.1.1",
"kind" : "object#logging",
"ip-address" : "10.1.1.2",
Deleting a Logging Object
Example
JSON Request
DELETE /api/v1/global/logging/10.1.1.1
JSON Response
Running-Config Resource
The Running-Config resource represents the Cisco IOS running configuration. Using this operation, you invoke a PUT operation by passing the snapshot of the running configuration as the request body.
Note
There is no JSON representation for this resource. It supports only a text/plain representation that corresponds to IOS text configuration. GET and PUT operations correspond to Export and Import IOS actions.
History
|
|
IOS XE 3.10 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Retrieving or Exporting the Running Configuration
Resource URI
|
|
GET |
/api/v1/global/running-config |
Example
JSON Request
GET /api/v1/global/running-config
JSON Response
Content-Type: "text/plain"
! Last configuration change at 16:07:15 IST Fri Jun 15 2012
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
Import the Running Configuration
Note
The running configuration file cannot contain a self-signed certificate. If the CSR already has a self-signed certificate, then the configuration file being imported cannot have a self-signed certificate unless the self-signed certificate is removed from CSR first.
Resource URI
|
|
PUT |
/api/v1/global/running-config |
Example
JSON Request
PUT /api/v1/global/running-config
Content-Type: "text/plain"
! Last configuration change at 16:07:15 IST Fri Jun 15 2012
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
JSON Response
SNMP Server Resource
History
|
|
IOS XE 3.11 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type. “object#snmp” |
ip-address |
string |
Mandatory |
IP Address of the SNMP server |
community-string |
string |
Mandatory |
SNMPv1/v2 community-string or SNMPv3 user name |
JSON Representation
"community-string" : {string}
Example
JSON Request
Content-Type: application/json
"ip-address" : "10.1.1.1",
"community-string" : "cisco123"
JSON Response
Location: https://host/api/v1/global/snmp/10.1.1.1_cisco123
Example
JSON Request
GET /api/v1/global/snmp/10.1.1.1_abc123
JSON Response
Content-Type: application/json
"ip-address" : "10.1.1.1",
"community-string" : "abc123"
Retrieve All SNMP Objects
Properties for Retrieve All
|
|
|
kind |
string |
Object type. Always “collection#snmp” |
items |
array |
Array of object#snmp |
JSON Representation
"kind" : "collection#snmp",
"items" : [ {object#snmp} ]
Example
JSON Request
JSON Response
Content-Type: application/json
"kind" : "collection#snmp",
"ip-address": "10.1.1.1",
"community-string": "abc123"
"ip-address": "10.1.1.2",
"community-string": "abc123"
Example
JSON Request
DELETE /api/v1/global/snmp/10.1.1.1_abc123
JSON Response
TACACS Server Resource
History
|
|
IOS XE 3.11 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type. “object#tacacs” |
name |
string |
Mandatory |
Name of TACAS server |
ip-address |
string |
Mandatory |
IP Address of the TACACS server |
key |
String |
Optional |
key Note : This key will not be returned in the GET API for security reasons. |
JSON Representation
"kind" : "object#tacacs",
Example
JSON Request
POST /api/v1/global/tacacs
Content-Type: application/json
"ip-address" : "10.1.1.1",
JSON Response
Location: https://host/api/v1/global/tacacs/primary
Example
JSON Request
GET /api/v1/global/tacacs/primary
JSON Response
Content-Type: application/json
"kind" : "object#tacacs",
Retrieve All TACACS Servers
Properties for Retrieve All
|
|
|
kind |
string |
Object type. Always “collection#tacacs” |
items |
array |
Array of object#tacacs |
JSON Representation for Retrieve All
"kind" : "collection#tacacs",
"items" : [ {object#tacacs} ]
Example
JSON Request
GET /api/v1/global/tacacs
JSON Re sponse
Content-Type: application/json
"kind" : "collection#tacacs",
"kind" : "object#tacacs",
"kind" : "object#tacacs",
Example
JSON Request
PUT /api/v1/global/tacacs/primary
Content-Type: application/json
"ip-address" : "10.1.1.1",
JSON Re sponse
Example
JSON Request
DELETE /api/v1/global/tacacs/primary
JSON Re sponse
Syslog Resource
This resource is used to retrieve the CSR logs. The Properties table describes the fields in the show processes cpu output.
History
|
|
IOS XE 3.10 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
|
kind |
string |
Must be “object#syslog-buffer” |
messages |
string |
Syslog messages |
JSON Representation
"kind": "object#syslog-buffer",
Example
JSON Request
GET /api/v1/global/syslog
JSON Response
Content-Type: application/json
"kind" : "object#syslog-buffer",
Reload Resource
Reloads/reboots the router after a specified interval, up to 60 minutes.
History
|
|
IOS XE 3.12 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
minutes |
number |
Mandatory |
Reloads after the specified interval in minutes. Range: 0 to 60 A value of 0 indicates an immediate reload and will terminate the REST HTTP session. |
Resource URI
|
|
PUT |
/api/v1/global/reload |
Example
JSON Request
PUT /api/v1/global/reload
Content-Type: application/json
JSON Response
Saving the REST API Configuration
This resource saves the REST API configuration file.
History
|
|
IOS XE 3.13 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms The following API is not supported: /api/v1/global/autosave-timer |
Saving the REST API configuration file (IOS write memory CLI command) introduces a delay of a few seconds, depending on the size of the configuration file. To reduce the impact that the write memory command has on the REST API performance, the configuration is saved at a fixed time interval.
Save the REST API configuration file. See Save REST API Configuration File.
Configure or retrieve the autosave interval. See Configure the Autosave Timer Interval.
The time interval is also configurable using a new CLI based on the restful-api CLI command.
Save REST API Configuration File
Resource URI
|
|
PUT |
/api/v1/global/save-config |
Example
JSON Request
PUT /api/v1/global/save-config
Content-Type: application/json
JSON Response
Configure the Autosave Timer Interval
Properties
|
|
Required for POST and PUT
|
|
timeout |
integer |
Mandatory |
Interval setting from 30 to 300 seconds |
Resource URI
|
|
PUT |
/api/v1/global/autosave-timer |
See Historyfor platform limitations. |
Example
JSON Request
PUT /api/v1/global/autosave-timer
Content-Type: application/json
JSON Response
Retrieve the Autosave Timer Interval
Resource URI
|
|
GET |
/api/v1/global/autosave-timer |
See Historyfor platform limitations. |
Example
JSON Request
GET /api/v1/global/autosave-timer
JSON Response
Content-type: application/json
IPv6 Resource
History
|
|
IOS XE 3.16 |
Introduced for the CSR1000V platform |
Properties
|
|
Required for POST and PUT
|
|
kind |
string |
Not applicable |
Object type: "object#ipv6-routing" |
unicast |
boolean |
Optional |
Enables the forwarding of IPv6 unicast datagrams |
multicast |
boolean |
Optional |
Enables the forwarding of IPv6 multicast datagrams |
JSON Representation
"kind": "object#ipv6-routing",
Support for Any CLI
This resource can be used to configure any CLI through the REST API.
History
|
|
IOS XE 3.16 |
Introduced for the CSR1000V platform |
Properties
|
|
Required for POST and PUT
|
|
config |
string |
Optional |
CLI to be applied in the config mode |
exec |
string |
Optional |
CLI to be applied in the exec mode |
show |
string |
Optional |
CLI to be run to show the results |
Configure a CLI in "config" Mode
Example
JSON Request
Content-Type: application/json
"config": "interface lisp0"
JSON Response
Configure Multiple CLIs in "config" Mode
Separate multiple CLIs with \n.
Example
JSON Request
Content-Type: application/json
"config": "crypto ssl proposal SSL_PROP \n protection rsa-aes128-sha1"
JSON Response
Configure a CLI to Show Output
Example
JSON Request
Content-Type: application/json
JSON Response
Content-Type: application/json
"kind": "object# cli-results",
"results": "Current privilege level is 15"
Configure Multiple CLIs in "exec" Mode
Separate multiple CLIs with \n.
Example
JSON Request
Content-Type: application/json
JSON Response
Content-Type: application/json
"kind": "object# cli-results",
"results": "Type escape sequence to abort.\nSending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:\n.....\nSuccess rate is 0 percent (0/5)"