System Configuration APIs
Action |
Method |
Payload Required |
API |
---|---|---|---|
To retrieve complete information on system configuration |
GET |
No |
/api/operational/system/settings-native /api/config/system/settings |
To configure the system by setting the default gateway, management IP address and/or WAN IP address |
PUT |
Yes |
/api/config/system/settings |
Example for System Configuration Payload
<system>
<settings>
<hostname>MyNFVIS123</hostname>
<mgmt>
<ip>
<address>192.168.1.2</address>
<netmask>255.255.255.0</netmask>
</ip></mgmt>
<wan>
<dhcp/>
</wan>
</settings>
</system>
Note |
In the example, the management interface is configured with a static IP address and the WAN interface is set to DHCP. You can configure both the management and the WAN interface with static IP addresses; however, you can configure DHCP on only one of the interfaces. |
Property |
Type |
Description |
Mandatory/Default Value |
||
hostname |
String |
Hostname of the system. The hostname now follows RFC952 rules, allowing only alphabets, numbers and hyphen. The hostname can begin and end with either an alphabet or a digit. Host software must handle host names of up to 255 characters. |
Yes | ||
default-gw |
String |
IP address of the default gateway.
|
Yes | ||
mgmt ip address |
String |
Management IP address
|
Yes | ||
mgmt ip netmask |
String |
Netmask for the IP address. |
Yes | ||
wan dhcp |
String |
Set dhcp on the WAN interface.
|
No |
Example: PUT System Configuration API
curl -v -u admin:admin -H "Accept:application/vnd.yang.data+xml" -H
"Content-Type:application/vnd.yang.data+xml" -k -X PUT
https://209.165.201.1/api/config/system -d
"<system>
<settings>
<hostname>Do3rdENCS75SettingsNoGW</hostname>
<default-gw>172.19.183.1</default-gw>
<mgmt>
<ip>
<address>172.19.183.75</address>
<netmask>255.255.255.0</netmask>
</ip>
</mgmt>
<wan>
<ip>
<address>4.3.2.5</address>
<netmask>255.255.0.0</netmask>
</ip><
/wan>
</settings>
</system>"
* Trying 209.165.201.1...
* Connected to 209.165.201.1 (172.19.183.75) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
* subject: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
* start date: Sep 2 17:03:09 2016 GMT
* expire date: Aug 31 17:03:09 2026 GMT
* issuer: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/system HTTP/1.1
> Host: 172.19.183.75
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.50.1
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml
> Content-Length: 281
>
* upload completely sent off: 281 out of 281 bytes
< HTTP/1.1 204 No Content
< Server: nginx/1.6.3
< Date: Wed, 07 Sep 2016 02:43:26 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 07 Sep 2016 02:43:25 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1473-216205-877863
< Pragma: no-cache
<
* Connection #0 to host 209.165.201.1 left intact
sj22lab-as1:149>
Example: GET System Details API
curl -k -v -u admin:admin -H Accept:application/vnd.yang.data+xml -H
Content-Type:application/vnd.yang.data+xml -X GET https://209.165.201.1/api/operational/system/settings-native
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 209.165.201.1...
* Connected to 209.165.201.1 (209.165.201.1) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
* subject: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
* start date: Sep 2 17:03:09 2016 GMT
* expire date: Aug 31 17:03:09 2026 GMT
* issuer: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> GET /api/operational/system/settings-native HTTP/1.1
> Host: 172.19.183.75
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.50.1
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml
>
< HTTP/1.1 200 OK
< Server: nginx/1.6.3
< Date: Tue, 06 Sep 2016 20:35:13 GMT
< Content-Type: application/vnd.yang.data+xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Pragma: no-cache
<
<settings-native xmlns="http://www.cisco.com/nfv" xmlns:y="http://tail-f.com/ns/rest" xmlns:system="http://www.cisco.com/nfv">
<mgmt>
<ip-info>
<interface>MGMT</interface>
<ipv4_address>192.168.1.2</ipv4_address>
<netmask>255.255.255.0</netmask>
<ipv6_address>fe80::2f2:8bff:fec3:4a54</ipv6_address>
<prefixlen>64</prefixlen>
<mac_address>00:f2:8b:c3:4a:54</mac_address>
<mtu>1500</mtu>
<txqueuelen>1000</txqueuelen>
</ip-info>
<stats>
<rx_packets>12481280</rx_packets>
<rx_bytes>14392431432</rx_bytes>
<rx_errors>0</rx_errors>
<rx_dropped>210</rx_dropped>
<rx_overruns>0</rx_overruns>
<rx_frame>0</rx_frame>
<tx_packets>3080505</tx_packets>
<tx_bytes>238975886</tx_bytes>
<tx_errors>0</tx_errors>
<tx_dropped>0</tx_dropped>
<tx_overruns>0</tx_overruns>
<tx_carrier>0</tx_carrier>
<tx_collisions>0</tx_collisions>
</stats>
<dhcp>
<enabled>false</enabled>
<offer>false</offer>
<interface>NA</interface>
<fixed_address>0.0.0.0</fixed_address>
<subnet_mask>0.0.0.0</subnet_mask>
<gateway>0.0.0.0</gateway>
<lease_time>0</lease_time>
<message_type>0</message_type>
<name_servers>NA</name_servers>
<server_identifier>0.0.0.0</server_identifier>
<renewal_time>0</renewal_time>
<rebinding_time>0</rebinding_time>
<vendor_encapsulated_options>NA</vendor_encapsulated_options>
<domain_name>NA</domain_name>
<renew>0001-01-01T00:00:00-00:00</renew>
<rebind>0001-01-01T00:00:00-00:00</rebind>
<expire>0001-01-01T00:00:00-00:00</expire>
</dhcp>
</mgmt>
<wan>
<ip-info>
<interface>wan-br</interface>
<ipv4_address>209.165.201.22</ipv4_address>
<netmask>255.255.255.0</netmask>
<ipv6_address>fe80::2f2:8bff:fec3:49e0</ipv6_address>
<prefixlen>64</prefixlen>
<mac_address>00:f2:8b:c3:49:e0</mac_address>
<mtu>1500</mtu>
<txqueuelen>0</txqueuelen>
</ip-info>
<stats>
<rx_packets>2971387</rx_packets>
<rx_bytes>420208255</rx_bytes>
<rx_errors>0</rx_errors>
<rx_dropped>229</rx_dropped>
<rx_overruns>0</rx_overruns>
<rx_frame>0</rx_frame>
<tx_packets>155</tx_packets>
<tx_bytes>45522</tx_bytes>
<tx_errors>0</tx_errors>
<tx_dropped>0</tx_dropped>
<tx_overruns>0</tx_overruns>
<tx_carrier>0</tx_carrier>
<tx_collisions>0</tx_collisions>
</stats>
<dhcp>
<enabled>false</enabled>
<offer>false</offer>
<interface>NA</interface>
<fixed_address>0.0.0.0</fixed_address>
<subnet_mask>0.0.0.0</subnet_mask>
<gateway>0.0.0.0</gateway>
<lease_time>0</lease_time>
<message_type>0</message_type>
<name_servers>NA</name_servers>
<server_identifier>0.0.0.0</server_identifier>
<renewal_time>0</renewal_time>
<rebinding_time>0</rebinding_time>
<vendor_encapsulated_options>NA</vendor_encapsulated_options>
<domain_name>NA</domain_name>
<renew>0001-01-01T00:00:00-00:00</renew>
<rebind>0001-01-01T00:00:00-00:00</rebind>
<expire>0001-01-01T00:00:00-00:00</expire>
</dhcp>
</wan>
<domain>NA</domain>
<dns>
<nameserver1>172.19.183.147</nameserver1>
<nameserver2>0.0.0.0</nameserver2>
<nameserver3>0.0.0.0</nameserver3>
</dns>
<hostname>Do3rdENCS75SettingsNoGW</hostname>
<gateway>
<ipv4_address>209.165.201.1</ipv4_address>
<interface>MGMT</interface>
</gateway>
</settings-native>
* Connection #0 to host 209.165.201.1 left intact