Published On: August 6ᵗʰ, 2019 02:12

API Reference for Cisco Enterprise Network Function Virtualization Infrastructure Software

Upgrade Package Register API

Table 1. Upgrade Package Register API

Action

Method

Payload Required

API

To register a package for upgrade

POST

Yes

/api/config/system/upgrade

To view registered packages

GET

No

  • /api/operational/system/upgrade/reg-info

  • /api/operational/system/upgrade

    /reg-info\?deep

  • /api/config/system/upgrade

To delete a registered package

DELETE

No

/api/config/system/upgrade/image-name

Example for Upgrade Package Register Payload


<image-name> 
 <name>test3</name>
 <location>/data/intdatastore/uploads/package/upgrade package filename(.nfvispkg)</location> 
</image-name> 
Table 2. Upgrade Package Register Payload Description

Property

Type

Description

Mandatory/Default Value

image-name

String

Name of the image

Yes

location

String

Location of the image Yes
/data/intdatastore/uploads

String

Default path of the image

Yes

upgrade package filename(.nfvispkg)

String

Full path with the package name.

  • If only one upgrade-package (.nfvispkg) exists on NFVIS /data/intdatastore/uploads directory, it's not necessary to specify the upgrade package name, after path /data/intdatastore/uploads.

  • When multiple upgrade-packages (.nfvispkg) exist on NFVIS /data/intdatastore/uploads, users need to specify specific upgrade-package to be registered, after path /data/intdatastore/uploads.

Example: POST Upgrade Package Register API


curl -k -v -u admin:admin -H content-type:application/vnd.yang.data+json -X 
POST https://209.165.201.1/api/config/system/upgrade --data '<image-name> <name>nfvis-3.6.1</name> <location>/data/intdatastore/uploads/Cisco_NFVIS_Upgrade-3.6.1-FC3.nfvispkg</location></image-name>'
*   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.0 (OUT), TLS handshake, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Server hello (2):
* TLSv1.0 (IN), TLS handshake, Certificate (11):
* TLSv1.0 (IN), TLS handshake, Server key exchange (12):
* TLSv1.0 (IN), TLS handshake, Server finished (14):
* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.0 (OUT), TLS change cipher, Client hello (1):
* TLSv1.0 (OUT), TLS handshake, Finished (20):
* TLSv1.0 (IN), TLS change cipher, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
*  start date: Aug  5 15:38:14 2016 GMT
*  expire date: Aug  3 15:38:14 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'
> POST /api/config/system/upgrade HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.49.1
> Accept: */*
> content-type:application/vnd.yang.data+json
> Content-Length: 33
>
* upload completely sent off: 33 out of 33 bytes
< HTTP/1.1 201 Created
< Server: nginx/1.6.3
< Date: Fri, 05 Aug 2016 17:34:35 GMT
< Content-Type: text/html
< Content-Length: 0
< Location: https://209.165.201.1/api/config/system/upgrade/image-name/test1
< Connection: keep-alive
< Last-Modified: Fri, 05 Aug 2016 17:34:33 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1470-418473-704300
< Pragma: no-cache

Example: GET Upgrade Package Register API


curl -k -v -u admin:admin -H content-type:application/vnd.yang.data+json -X 
GET https://209.165.201.1/api/operational/system/upgrade/reg-info

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: Mar 31 02:47:22 2017 GMT
*  expire date: Mar 29 02:47:22 2027 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/upgrade/reg-info HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> content-type:application/vnd.yang.data+json
> 
< HTTP/1.1 200 OK
< Server: nginx/1.10.1
< Date: Fri, 31 Mar 2017 22:34:27 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
< 

<reg-info xmlns="http://www.cisco.com/nfv" xmlns:y="http://tail-f.com/ns/rest"  xmlns:system="http://www.cisco.com/nfv">
  <name>
    <name>Cisco_NFVIS_Upgrade-3.6.1-693-20170329_022604.nfvispkg</name>
  </name>
</reg-info>
* Connection #0 to host 209.165.201.1 left intact


Example: DELETE Upgrade Package Register API


curl -k -v -u admin:admin -X DELETE https://209.165.201.1/api/config/system/upgrade/image-name/nfvis-3.3.1

*   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.0 (OUT), TLS handshake, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Server hello (2):
* TLSv1.0 (IN), TLS handshake, Certificate (11):
* TLSv1.0 (IN), TLS handshake, Server key exchange (12):
* TLSv1.0 (IN), TLS handshake, Server finished (14):
* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.0 (OUT), TLS change cipher, Client hello (1):
* TLSv1.0 (OUT), TLS handshake, Finished (20):
* TLSv1.0 (IN), TLS change cipher, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
*  start date: Aug  5 15:38:14 2016 GMT
*  expire date: Aug  3 15:38:14 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'
> DELETE /api/config/system/upgrade/image-name/nfvis-3.3.1 HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.49.1
> Accept: */*
>
< HTTP/1.1 204 No Content
< Server: nginx/1.6.3
< Date: Fri, 05 Aug 2016 19:36:57 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Fri, 05 Aug 2016 19:36:57 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1470-425817-671801
< Pragma: no-cache

Upgrade Apply-Image APIs

Table 3. Upgrade Apply-Image API

Action

Method

Payload Required

API

To upgrade the existing image to a newly registered image

POST

Yes

/api/config/system/upgrade

To verify the upgrade status

GET

No

  • /api/operational/system/upgrade/apply-image

  • /api/operational/system/upgrade/apply-image\?deep

To delete the upgraded image

DELETE

No

/api/config/system/upgrade/

/apply-image/<image-name>

Example for Upgrade Apply-Image Payload


<apply-image> 
 <name>nfvis-3.3.1</name> 
 <scheduled-time>24</scheduled-time> 
</apply-image> 
Table 4. Upgrade Apply-Image Payload Description

Property

Type

Description

Mandatory/Default Value

name string Name of the image for the upgrade Yes
scheduled-time Numeric Scheduled time in hours. Valid range: 0-24. Zero means immediate upgrade. Yes

Example: POST Upgrade Apply-Image API


curl -k -v -u admin:admin -H content-type:application/vnd.yang.data+json -X 
POST https://209.165.201.1/api/config/system/upgrade --data '<apply-image> <name>nfvis-3.3.1</name> <scheduled-time>24</scheduled-time> </apply-image>'
*   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.0 (OUT), TLS handshake, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Server hello (2):
* TLSv1.0 (IN), TLS handshake, Certificate (11):
* TLSv1.0 (IN), TLS handshake, Server key exchange (12):
* TLSv1.0 (IN), TLS handshake, Server finished (14):
* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.0 (OUT), TLS change cipher, Client hello (1):
* TLSv1.0 (OUT), TLS handshake, Finished (20):
* TLSv1.0 (IN), TLS change cipher, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
*  start date: Aug  5 15:38:14 2016 GMT
*  expire date: Aug  3 15:38:14 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'
> POST /api/config/system/upgrade HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.49.1
> Accept: */*
> content-type:application/vnd.yang.data+json
> Content-Length: 53
>
* upload completely sent off: 53 out of 53 bytes
< HTTP/1.1 201 Created
< Server: nginx/1.6.3
< Date: Fri, 05 Aug 2016 18:41:02 GMT
< Content-Type: text/html
< Content-Length: 0
< Location: https://209.165.201.1/api/config/system/upgrade/apply-image/nfvis-3.3.1
< Connection: keep-alive
< Last-Modified: Fri, 05 Aug 2016 18:41:02 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1470-422462-89670
< Pragma: no-cache
<
* Connection #0 to host 209.165.201.1 left intact

Example: GET Upgrade Apply-Image API


curl -k -v -u admin:admin -H content-type:application/vnd.yang.data+json -X 
GET https://209.165.201.1/api/operational/system/upgrade/apply-image

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: Mar 31 02:47:22 2017 GMT
*  expire date: Mar 29 02:47:22 2027 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/upgrade/apply-image HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> content-type:application/vnd.yang.data+json
> 
< HTTP/1.1 200 OK
< Server: nginx/1.10.1
< Date: Fri, 31 Mar 2017 22:34:49 GMT
< Content-Type: application/vnd.yang.collection+xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Pragma: no-cache
< 
<collection xmlns:y="http://tail-f.com/ns/rest">
  <apply-image xmlns="http://www.cisco.com/nfv">
    <name>Cisco_NFVIS_Upgrade-3.6.1-693-20170329_022604.nfvispkg</name>
    <scheduled-time>24</scheduled-time>
    <status>SCHEDULED</status>
  </apply-image>
</collection>
* Connection #0 to host 209.165.201.1 left intact


Example: DELETE Upgrade Apply-Image API


curl -k -v -u admin:admin -X DELETE https://209.165.201.1/api/config/system/upgrade/apply-image/nfvis-3.3.1

*   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.0 (OUT), TLS handshake, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Server hello (2):
* TLSv1.0 (IN), TLS handshake, Certificate (11):
* TLSv1.0 (IN), TLS handshake, Server key exchange (12):
* TLSv1.0 (IN), TLS handshake, Server finished (14):
* TLSv1.0 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.0 (OUT), TLS change cipher, Client hello (1):
* TLSv1.0 (OUT), TLS handshake, Finished (20):
* TLSv1.0 (IN), TLS change cipher, Client hello (1):
* TLSv1.0 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=Cisco-Enterprise-NFVIS-Self-Signed-Certificate
*  start date: Aug  5 15:38:14 2016 GMT
*  expire date: Aug  3 15:38:14 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'
> DELETE /api/config/system/upgrade/apply-image/nfvis-3.3.1 HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.49.1
> Accept: */*
>
< HTTP/1.1 204 No Content
< Server: nginx/1.6.3
< Date: Fri, 05 Aug 2016 19:57:32 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Fri, 05 Aug 2016 19:57:32 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1470-427052-771331
< Pragma: no-cache
<
* Connection #0 to host 209.165.201.1 left intact