VM Image Registration APIs
Action |
Method |
Payload Required |
API |
Image registration |
POST |
Yes |
/api/config/vm_lifecycle/images |
Get image configuration |
GET |
No |
/api/config/vm_lifecycle/images?deep |
Get image status |
GET |
No |
/api/operational/vm_lifecycle/opdata/images/image /<image_name>?deep |
Image Unregistration |
DELETE |
No |
/api/config/vm_lifecycle/images/image/<image_name> |
Example for Image Registration Payload
<image>
<name>isrv9.16.03.01</name>
<src>http://<filename_with_full-path-of-the-file>/isrv-universalk9.16.03.01.tar.gz</src>
</image>
<image>
<name> mytiny2</name>
<src>file:///data/mount/nfs_storage/repository/TinyCore-current.iso</src>
<properties>
<property>
<name>placement</name>
<value>nfs_storage</value>
</property>
</properties>
</image>
Added in NFVIS 3.12.x release:
<image>
<name>isrv</name>
<src>https://esc-soltest-124/nfvis/isrv-universalk9.16.03.01.tar.gz</src>
<certificate_validation>true</certificate_validation>
<certificate_string>"-----BEGIN CERTIFICATE-----
MIID2TCCAsGgAwIBAgIJAOySjdTedBEyMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNVBAcMAlNKMQ4wDAYDVQQKDAVDaXNj
bzEMMAoGA1UECwwDRVNDMRgwFgYDVQQDDA9lc2Mtc29sdGVzdC0xMjQxITAfBgkq
hkiG9w0BCQEWEmFydmluZGtzQGNpc2NvLmNvbTAeFw0xOTA0MDUxMDQ3NDRaFw0y
MDA0MDQxMDQ3NDRaMIGCMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExCzAJBgNV
BAcMAlNKMQ4wDAYDVQQKDAVDaXNjbzEMMAoGA1UECwwDRVNDMRgwFgYDVQQDDA9l
c2Mtc29sdGVzdC0xMjQxITAfBgkqhkiG9w0BCQEWEmFydmluZGtzQGNpc2NvLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN+f6mSR3C5f7bm0622r
hy8IVmF64cjPEjJL7uVa0wid4ohqH7PYjZLlxecWjzwqboMBMX8f5dpqoCCfpIwV
aMDMNQPAWDkLB8D04GgHfZUGmbrKnC/9vzopfIr6zhIsuHU1UGfMu9V+gSK8/1Yd
DXsco4s+JOO+ke+sO+cxghKKzh36R+O6aYNlqNCE3vCIQ91abfx/8pOVGy7+T01g
t9y4v3nTIU0cGAvj6ag6QnQFacU75mYrdHq1SoDF6sJoQhUq3YmiAKVnEKp836sB
jHIDveWqgsj+0aiqHg8z4a6t0WTF1ssVES5mORVY7R2MLcYPtpGedWWW56emuGIe
sbUCAwEAAaNQME4wHQYDVR0OBBYEFBKP8tNQEJCEsof5DqaoDuv4VMWjMB8GA1Ud
IwQYMBaAFBKP8tNQEJCEsof5DqaoDuv4VMWjMAwGA1UdEwQFMAMBAf8wDQYJKoZI
hvcNAQELBQADggEBADg04m/U1H12lIacF9ZeItoxp62YDvjszrblj9iKQWxPzPr/
5kbafATak0rAZQ4tHwAGHD6uvmW5zeo5RUMFHDx/FHU+tzjP3dmwSnBAkhicZBu4
uG6ri3PWEPXUlgx/v7liiwYmgT8gCZ7ToD1XzR8x1fPAGwAL48xRmXqiW57cuHWN
RireQ+aIBr7IT61TjdiXnldnjfXcIHGRJStOqoE1QKD44Awq8oguhzOnIyOlZ/AQ
YTv1IYXBvKfDa91EdMS5k6hjeLWjMLYjHWrrB94elQonP6nGfKwD/Zfhsz+1KG6U
JmPyR3GTWwbpB8TmiD80hSXDJNxuHpTRdSO5BUc=
-----END CERTIFICATE-----"</certificate_string>
</image>
<image>
<name>isrv</name>
<src>https://esc-soltest-124/nfvis/isrv-universalk9.16.03.01.tar.gz</src>
<certificate_validation>true</certificate_validation>
<certificate_file>file:///data/intdatastore/uploads/esc-soltest-124.cert</certificate_file>
</image>
Property |
Type |
Description |
Mandatory/Default Value |
name | String | Name of the VM image | Yes |
src | URL | Full path of the VM image | Yes |
Added in NFVIS 3.12.x release | |||
certificate_validation | True/false | Enable certificate validation by setting this tag to "true" | Yes |
certificate_string | String | Validate Web-server with the raw contents of a certificate file | Yes |
certificate_file | URL | Validate Web-server with a certificate file | Yes |
Example: POST Image Registration API
curl -v -u -k admin:admin -H Accept:application/vnd.yang.data+xml -H Content-Type:application/vnd.yang.data+xml
-X POST https://<NFVIS_IP>/api/config/vm_lifecycle/images -d '<image><name>WinServer2012R2.iso</name><src><filename_with_full-path-of the-file>/WinServer2012R2.iso</src></image>'
\* About to connect() to 209.165.201.1 port 80 (#0)
\* Trying 209.165.201.1...
\* Connected to 209.165.201.1 (209.165.201.1) port 80 (#0)
\* Server auth using Basic with user 'admin'
> POST /api/config/vm_lifecycle/images HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.29.0
> Host: 209.165.201.1
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml
> Content-Length: 87
>
\* upload completely sent off: 87 out of 87 bytes
< HTTP/1.1 201 Created
< Server:
< Location: [http://209.165.201.1/api/config/vm_lifecycle/images/image/WinServer2012R2.iso]
< Date: Thu, 10 Dec 2015 11:15:50 GMT
< Last-Modified: Thu, 10 Dec 2015 11:15:50 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1449-746150-710421
< Content-Length: 0
< Content-Type: text/html
< Pragma: no-cache
<
\* Connection #0 to host 209.165.201.1 left intact
Example: POST Image Registration to External Disk API
curl -k -v -u admin:Cisco123# -H Accept:application/vnd.yang.data+xml -H Content-Type:application/vnd.yang.data+xml -X POST https://209.165.201.1/api/config/vm_lifecycle/images -d '<image><name>Linuxnew</name><src>file:///mnt/extdatastore2/uploads/TinyLinux.tar.gz</src><properties><property><name>placement</name><value>datastore3</value></property></properties></image>'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 209.165.201.1...
* TCP_NODELAY set
* Connected to 209.165.201.1 (209.165.201.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
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
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: CN=nfvis
* start date: Jun 12 19:40:33 2018 GMT
* expire date: Jun 11 19:40:33 2023 GMT
* issuer: CN=nfvis
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> POST /api/config/vm_lifecycle/images HTTP/1.1
> Host: 209.165.201.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.54.0
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml
> Content-Length: 190
>
* upload completely sent off: 190 out of 190 bytes
< HTTP/1.1 201 Created
< Server: nginx
< Date: Tue, 12 Jun 2018 22:59:05 GMT
< Content-Type: text/html
< Content-Length: 0
< Location: https://172.25.221.106/api/config/vm_lifecycle/images/image/Linuxnew
< Connection: keep-alive
< Last-Modified: Tue, 12 Jun 2018 22:59:04 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1528-844344-814906
< Pragma: no-cache
<
* Connection #0 to host 209.165.201.1 left intact
Example: GET Image Configuration 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/config/vm_lifecycle/images?deep
\* About to connect() to 209.165.201.1 port 80 (#0)
\* Trying 209.165.201.1...
\* Connected to 209.165.201.1 (209.165.201.1) port 80 (#0)
\* Server auth using Basic with user 'admin'
> GET /api/config/vm_lifecycle/images?deep HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.29.0
> Host: 209.165.201.1
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml
>
< HTTP/1.1 200 OK
< Server:
< Date: Thu, 10 Dec 2015 11:16:10 GMT
< Last-Modified: Thu, 10 Dec 2015 11:15:50 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1449-746150-710421
< Content-Type: application/vnd.yang.data+xml
< Transfer-Encoding: chunked
< Pragma: no-cache
<
<images xmlns="[http://www.cisco.com/esc/esc|http://www.cisco.com/nfvis/vm_lifecycle]" xmlns:y="[http://tail-f.com/ns/rest|http://tail-f.com/ns/rest]" xmlns:esc="[http://www.cisco.com/nfvis/vm_lifecycle|http://www.cisco.com/nfvis/vm_lifecycle]">
<image>
<name>isrv-9.16.03.01</name>
<src>http://data/nfvos-pkg/isr/isrv-universalk9.16.03.01.tar.gz</src>
</image>
</images>
\* Connection #0 to host 209.165.201.1 left intact
Example: GET Image Status 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/vm_lifecycle/opdata/images/image/isrv-03.16.02?deep
/* About to connect() to 209.165.201.1 port 80 (#0)
/* Trying 209.165.201.1...
/* Connected to 209.165.201.1 (209.165.201.1) port 80 (#0)
/* Server auth using Basic with user 'admin'
> GET /api/operational/vm_lifecycle/opdata/images/image/isr-image?deep HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.29.0
> Host: 209.165.201.1
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml
> < HTTP/1.1 200 OK
< Server:
< Date: Thu, 10 Dec 2015 11:16:22 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Content-Type: application/vnd.yang.data+xml< Transfer-Encoding: chunked
< Pragma: no-cache<
<image xmlns="http://www.cisco.com/nfvis/vm_lifecycle" xmlns:y="http://tail-f.com/ns/rest" xmlns:esc="http://www.cisco.com/nfvis/vm_lifecycle">
<name>isrv.03.16.02</name>
<image_id>585a1792-145c-4946-9929-e040d3002a59</image_id>
<public>true</public>
<state>IMAGE_ACTIVE_STATE</state></image>
/* Connection #0 to host 209.165.201.1 left intact
![]() Note |
The supported image states are:
|
Example: DELETE Image Registration API
curl -k -v -u admin:admin -H Accept:application/vnd.yang.data+xml -H Content-Type:application/vnd.yang.data+xml -X
DELETE https://209.165.201.1/api/config/vm_lifecycle/images/image/isrv-3.16.0.1a
/*About to connect() to 209.165.201.1 port 80 (#0)
/* Trying 209.165.201.1...
/* Connected to 209.165.201.1 (209.165.201.1) port 80 (#0)
/* Server auth using Basic with user 'admin'
> DELETE /api/config/vm_lifecycle/images/image/isr-image HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.29.0
> Host: 209.165.201.1
> Accept:application/vnd.yang.data+xml
> Content-Type:application/vnd.yang.data+xml>
< HTTP/1.1 204 No Content
< Server:
< Date: Thu, 10 Dec 2015 12:44:28 GMT
< Last-Modified: Thu, 10 Dec 2015 12:44:28 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1449-751468-864441
< Content-Length: 0
< Content-Type: text/html
< Pragma: no-cache
</* Connection #0 to host 209.165.201.1 left intact