Commit Graph

19 Commits (59e166b62a11ee4adfc92abea91f0224a4789476)

Author SHA1 Message Date
Aldinson Esto 9d95f91504 Support flow of Getting VNF package
Supported the following operations to get the VNF package
information from NFVO when starting LCM operation.
    - VNF packages (GET)
    - VNF package content (GET)
    - VNFD in an individual VNF package (GET)
    - Individual VNF package artifact (GET)

Implements: blueprint support-vnfm-operations
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-sol003-vnfm-operations.html

Change-Id: Ibdafdda815f8e130226b9d8eef4f18639f01292c
3 years ago
Koichi Edagawa a7dc3ab6b5 Support of OAuth2.0
Supported OAuth2.0 as the part of the feature of branching VNFM
and NFVO in Tacker.
This includes Client/Basic certification.

Implements: blueprint support-vnfm-operations
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-sol003-vnfm-operations.html

Change-Id: I025579dcfe6f0b020bb00dcb90a7d33e49b7cac9
3 years ago
Koichi Edagawa 13065dfbdd Support Flow of the Get Operation Status
Supported Flow of the Get Operation Status as the part of
LCM notifications for VNF based on ETSI NFV-SOL specification.

Implements: blueprint support-etsi-nfv-specs
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-notification-api-based-on-etsi-nfv-sol.html

Change-Id: Id23d025aeba568c4c67adc745171c0540140d233
3 years ago
Aldinson Esto f8f58e8cec Support LCM notifications for VNF based on ETSI
Supported for Flow of sending notifications as defined in ETSI SOL003.

Notify LCM status to the cannback URL registered in subscription
Support for transmission processing from each LCM

Implements: blueprint support-etsi-nfv-specs
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-notification-api-based-on-etsi-nfv-sol.html

Change-Id: Idff7a98490ee87bb034d346cfda943bf03620b57
3 years ago
LiangLu c0647bde69 Implementation Artifacts support in Tacker
Implements: blueprint add-artifacts-vnf-packages

* Add artifacts support for vnf packages:
  * Read and verify artifacts from TOSCA.meta and manifest file.
  * Modify and add artifact related APIs

Change-Id: Iad045407338535022aa385b57125225ee6253732
3 years ago
Yasufumi Ogawa a3649b6811 Fix many ResourceWarning messages in tox
This update is to fix `ResourceWarning` messages while running tox
tests because file descriptors are not closed explicitly after each
of tests. Although these tests are completed as `succeeded`, such nouse
warnings make hard to inspect log messages.

Closes-Bug: #1881416

Change-Id: Icff5315969a1303fcbf71ecddfaa7ea0c99a3e5b
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
3 years ago
Shubham 46bb74019c Avoid use of zip files in unit tests
Replaced the zip files by creating respective directories which is used
as the test data for unit test cases.

Addressed review comment [1] in this patch.

[1]: https://review.opendev.org/#/c/707802/26/tacker/tests/unit/vnflcm/test_vnflcm_driver.py@326
Change-Id: I6a19debe94c2707b6145003d428db9704bda02ee
3 years ago
Sean McGinnis 41a21bc807 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I130c03e12ddc53ce7ced728a43b10b142f7b066f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: Hiroo Kitamura <hiroo.kitamura@ntt-at.co.jp>
3 years ago
asmita singh ab50e471b9 Auth parameters for uploading vnf package from URI
Upload VNF Package from uri REST API accepts userName and password
parameter but internally these parameters are not used while getting
the csar zip file from the URI as specified in the addressInformation.
If the server serving the CSAR zip requires authentication, it would
return 401 error and the uploading vnf package will fail to set the VNF
package to onboarded status.

This patch uses userName and password parameters to set "Authorization"
header as shown below if these parameters are passed in the request body.

* The userName and password are combined with a single colon (:).
This means that the username itself cannot contain a colon.
* The resulting string is encoded using a variant of Base64.
* The authorization method (Basic and a space (e.g. "Basic ") is then
prepended to the encoded string.

For example, if userName and password is "xyz" and "xyzpassword", then
the field's value is the base64-encoding of xyz:xyzpassword, or
eHl6Onh5enBhc3N3b3Jk. Then the Authorization header will appear as:

Authorization: Basic eHl6Onh5enBhc3N3b3Jk

Change-Id: Ie79d5e4659951f41db4a1003950c649acab8b439
3 years ago
Sameer d3cc82139e Fetch an on-boarded VNF package with HTTP_RANGE
The GET method fetches the content of a VNF package identified by
the VNF package identifier allocated by the NFVO.

The 'HTTP_RANGE' header is inspected for a valid value.
If it is present and valid, then the package content within
the range is fetched.If not present the entire content is
fetched

A 'size' column has been added to vnf_packages db table.
When the VNF package content is uploaded, the size of the
csar zip is persisted in this newly added 'size' column of
vnf_packages db table.

When VNF_Package content is fetched for the first time, its size is
retrieved from glance store and the size column in vnf packages table
is populated with this value. For subsequent fetch calls the size of
csar file content is retrieved from 'size' column in vnf_packages
table.

A lot of the content fetching code has been reused from
glance/api/v2/image_data.py ResponseSerializer class
download function

Blueprint: bp/enhance-vnf-package-support-part1

Change-Id: Ib49ef8b1e81ca4a4b7e3ac4a0836c111ce7da4a3
3 years ago
tpatil cff8c75682 Sychronize vnf action tasks
Used tooz distribued lock mechanism for synchronizing various
vnf instance tasks like instantiate, terminate and heal. It
supports various backends, such as etcd, mysql, file locks, redis,
zookeeper, etc.

This change imports the "coordination" module, which is shared by
Cinder, Manila and a few other projects.

The lock backend can be selected using the CONF.coordination.backend_url
config option.

Change-Id: Ia4979571e788ecc4874ae0b62533fbc5277253a8
Blueprint: support-etsi-nfv-specs
3 years ago
tpatil b4f357f2b3 Add heal vnf instance API
Implemented heal vnf instance API.
* POST /vnflcm/v1/vnf_instances/{vnf_instance_id}/heal}

Co-authored-By: Ajay Parja <ajay.parja@nttdata.com>
Co-authored-By: Nitin Uikey <nitin.uikey@nttdata.com>
Co-authored-By: Shubham Potale <shubham.potale@nttdata.com>

Change-Id: I38bdac64a8a3eb3f8880085b5a77db97e5a1a8f2
Blueprint: support-etsi-nfv-specs
3 years ago
Ajay Parja fbb38266d6 Add terminate vnf instance API
Implemented terminate vnf instance API.

* GET /vnflcm/v1/vnf_instances/{vnf_instance_id}/terminate

Co-Authored-By: tpatil <tushar.vitthal.patil@gmail.com>
Co-Authored-By: Shubham Potale <shubham.potale@nttdata.com>
Co-Authored-By: Sameer Thakur <sameer.thakur@nttdata.com>
Change-Id: I69b7ef12038aa410db7e50671df2931beb761223
Blueprint: support-etsi-nfv-specs
3 years ago
Niraj a14590620b Add instantiate vnf instance API
Implemented instantiate vnf instance API.

* GET /vnflcm/v1/vnf_instances/{vnf_instance_id}/instantiate

Co-authored-By: Nitin Uikey <nitin.uikey@nttdata.com>
Co-authored-By: tpatil <tushar.vitthal.patil@gmail.com>
Co-authored-By: Ajay Parja <ajay.parja@nttdata.com>
Co-authored-By: Shubham Potale <shubham.potale@nttdata.com>
Co-authored-By: Sameer Thakur <sameer.thakur@nttdata.com>

Updated lower-constraints openstacksdk version to 0.44.0 as it
includes fix[1] which is required to create images from filename
which further requires to upgrade os-service-types, keystoneauth1
and decorato to higher versions.

[1] : https://review.opendev.org/#/c/710368

Change-Id: Ic30f8d730d54e3af1345816ffa1bfb702cd00694
Blueprint: support-etsi-nfv-specs
3 years ago
Shubham Potale f03b615bfe Implement RestFul API to read VNFD of an on-boarded VNF package
The VNFD can be implemented as a single file or as a collection of
multiple files. If the VNFD is implemented in the form of multiple
files, a ZIP file embedding these files shall be returned. If the VNFD
is implemented as a single file, either that file or a ZIP file
embedding that file shall be returned.

Implemented below API:-

* GET /vnf_packages/{vnfPkgId}/vnfd

Change-Id: I4af9c8126fb7478da294bc99a176eabba3944564
Implements: bp enhance-vnf-package-support-part1
3 years ago
Niraj 9dd0823c95 Support patch to fix window style line ending
Pep8 didn't recognised this error because it was running
on python2. Now tacker is going to support python3 so this
window style line ending should be fixed.

This patch removed window style line endings.

Change-Id: I2dfee4967545aba5ea54561dc4910df02b0a9c98
3 years ago
Niraj Singh 4fa204b370 Add vnf packages RestFul APIs
Implemented following APIs:-

* GET    /vnf_packages
* POST   /vnf_packages/
* GET    /vnf_packages/{vnfPkgId}
* DELETE /vnf_packages/{vnfPkgId}
* PUT    /vnf_packages/{vnfPkgId}/package_content
* POST   /vnf_packages/{vnfPkgId}/package_content/upload_from_uri

Partial-Implements: blueprint tosca-csar-mgmt-driver

Depends-On: If8155399df12a96cb86631dfa22eaca7a5a8d398

Co-Author: Neha Alhat <neha.alhat@nttdata.com>
Change-Id: Id3b4812e24a1ed84fe94429e074f96ae11530517
4 years ago
Niraj Singh a95ffbc668 Implement rpc conductor for vnf packages
Added new RPC APIs for uploading and deleting vnf packages.

Partial-Implements: blueprint tosca-csar-mgmt-driver

Co-Author: Neha Alhat <neha.alhat@nttdata.com>
Change-Id: Ia5051f3c1bf2ce5f45c94711a67be5f9a8ef21d0
4 years ago
Yan Xing'an dabd18d326 Refactoring UT directories
Adding some corresponding directories to UT, and
moving some cases to right places.

Partially Implements: blueprint test-addition-refactoring

Change-Id: Ic47ea2640c89787ac291c31db51a8529f73a66a3
5 years ago