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
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
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found by updated hacking version.
Update local hacking checks for new flake8.
Remove hacking and friends from lower-constraints, they are not
needed in installations.
Change-Id: If787d610315be6c973b4335e047242c3aa3caf2a
As per ETSI GS NFV-SOL 005 V2.4.1 (2018-02) table 9.4.2.3.2-2, GET Vnf
Packages should return list of all Vnf packages, but as per current
implemention this api is returning dictionory with resource name as key
i.e {'vnf_packages': [{vnf_package1}, {vnf_package2},...]}. Hence
removing the resource key and returning api response as a list.
As per process to fix this issue we need to provide micro version
support in tacker as well as in python-tackerclient for command.
The list api was part of VNF package api which released in train cycle.
But we can not instantiate, terminate and Heal VNF as these feature is
not released yet and about to release in U cycle. The changes we have
proposed will be useful after U release and that is why we think we
should do these change without micro version support.
Closes-bug: #1871054
Change-Id: I7f5105fc7a49f9d31fb32119c725dae0421cfde7
Implement new method of VNF lifecycle management using LCM operation
user data.
Change-Id: Ib2fbe341b5d26758f0b48dc19e3e05810c2c830f
Blueprint: support-etsi-nfv-specs
Certain resource representations can become quite big, in particular
``GET /vnfpackages`` API which is a container for multiple sub-resources.
In these cases, it can be desired to reduce the amount of data exchanged
over the interface and processed by the API consumer application.
An attribute selector i.e filter, allows the API consumer to choose
which attributes it wants to be contained in the response. Only
attributes that are not required to be present, i.e. those with
a lower bound of zero on their cardinality (e.g. 0..1, 0..N)
and that are not conditionally mandatory, are allowed to be omitted
as part of the selection process.
This patch implements attribute filtering for ``GET /vnfpackages`` API.
It will support following query parameters:-
* filter: Filter criterion built with attributes of VNF Package and
REST operators.
* all_fields: Return all fields
* fields=<list> : Return fields specified in the <list>
* exclude_fields=<list>: Return fields not specified in the <list>
* exclude_default parameters: Return all fields except default fields
* exclude_default and fields=<list>: Return all fields except default
fields and fields in the <list>
* When no parameter is specified it is treated as exclude_default.
You can find more details about supported query parameters in document:
ETSI GS NFV-SOL 013 V2.6.1 (2019-03 in section 5.2 and 5.3
Co-Authored-By: Prashant Bhole <prashant.bhole@nttdata.com>
Change-Id: I1513d7d87967de5248787cd298c3bec65c2dde9d
Implements: bp/enhance-vnf-package-support-part1
Added db support to filter out the vnf packages as per the
filter rule specified in the `filter` query parameter.
Made use of ready-made 'sqlalchemy-filters' library which
can apply filters to the query object dynamically.
You can find few examples on home page of sqlalchemy-filters
github repository:
https://github.com/juliotrigo/sqlalchemy-filters
Change-Id: Iddf0ba7445fa7739440d333d914e675bd0782040
Implements: bp/enhance-vnf-package-support-part1
Added schema to validate following query parameters:-
1. filter
2. all_fields
3. exclude_fields
4. fields
5. exclude_default
Business rules are defined in ETSI GS NFV-SOL 013 V2.6.1 (2019-03),
section 5.2 and 5.3.
Change-Id: I01cf08f46ffd69d10f5afde430c42c4bc211bd25
Implements: bp/enhance-vnf-package-support-part1
Added filter rule engine to process filter query parameter as
defined in ETSI GS NFV-SOL 013 V2.6.1 (2019-03), section 5.2
`Attribute-based filtering`.
For example,
Request:
GET .../vnfpkgm/v1/vnf_packages/filter=(eq,onboardingState,CREATED)
It will return list of vnf packages matching `onboardingState` to
`CREATED`.
The concept of filter rule engine is based on the oslo.policy
rule engine.
Change-Id: I25bd70291b93b734148d19740536065b10aaf524
Implements: bp/enhance-vnf-package-support-part1
Added documentation for following vnflcm APIs:-
1. Create Vnf instance API
2. Instantiate Vnf API
3. Heal Vnf API
4. Terminate Vnf API
5. List Vnf API
6. Show API
7. Delete API
Change-Id: I4ca0d8a15ae422de0d04e3e5570e43ec841acac8
blueprint: bp/support-etsi-nfv-specs
Added functional tests for all support vnflcm APIs:-
1. Create Vnf instance API
2. Instantiate Vnf API
3. Heal Vnf API
4. Terminate Vnf API
5. List Vnf API
6. Show API
7. Delete API
Change-Id: Id8aff0f41caed6d52b20e7e5604dc28d8c56c567
blueprint: bp/support-etsi-nfv-specs
test_upload_from_file_and_delete functional test is failing
as the vnf package 'operationalState' is not DISABLED
before deletion.
To fix this issue, I have merged two existing FTs into new one
which will test the flow - create, upload, update, show and delete.
* Deleted existing FT
test_upload_from_file_and_delete
test_patch_in_onboarded_state
* Added new FT
test_upload_from_file_update_show_and_delete.
* Fixed get vnfd related functional tests by setting package
operational state to DISABLED before deleting
* assert_resp_contents method now uses assertCountEqual to compare
list of string as it ignores order of items in the list.
Closes-bug: #1866776
Change-Id: I310f4206527cfe215116f8d85acdb1f519d67a97
Vnf package wsgi app doesn't require extensions
so this patch removes it from composite:vnfpkgmapi_v1.
Change-Id: I724937cd5febc3fd83d8b76a922fae4ed5f5f939
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
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
This is user guide for Multi interface of Containerized VNF.
Implement blueprint multi-interface-container
Change-Id: I427d1c51e0a1d5fc65ab723ac9222396666cf5b1
In VNFLCM, we are planingg to execute instantiation VNF task in the tacker
conductor service. During this instantiation task, Heat-translator would
create the required hot resource yaml files in the /tmp directory so it's
important to set the workingDirectory property in
/etc/systemd/system/tacker-conductor.service as it's done in the
/etc/systemd/system/tacker.service for tacker server service.
Blueprint: support-etsi-nfv-specs
Change-Id: I10a1e55f2f9fc640fa9f405ad4ee78a0ac2e640f
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
This patch fixes the issue for uploading single yaml casr.
It was reading the flavour details from the nested template
only in the earlier code.
Change-Id: Ibf86ed06e940a0b9aaaa8eaf63f3249be1462e36
Closes-Bug: #1861754
In Vnf LCM, when user will call create vnf instance API, vnfdId
will be passed in the CreateVnfRequest as per SOL002,
section 5.5.2.3 [1]. Based on this vnfdId, it will look for the
vnf package to load the csar package at the time of instantiating vnf
instance. So it's important that vnfdId is unique in the
``vnf_package_vnfd`` dbb table.
Added ``vnfd_id`` and ``deleted`` columns as unique key in
``vnf_package_vnfd`` db table.
[1] : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.06.01_60/gs_nfv-sol002v020601p.pdf
Change-Id: I2da2acf256bec307b606c5a152c0d47af24ad525
Blueprint: support-etsi-nfv-specs
Added API to update information of VNF package.
Implemented below API:-
* PATCH /vnf_packages/{vnfPkgId}
Co-authored-by: Shubham Potale <shubham.potale@nttdata.com>
Change-Id: I6d60e87b48a6703362dcd30975f300f524f8ca7a
Implements: bp enhance-vnf-package-support-part1
From last couple of months, the functional devstack job was broken.
Fixed the devstack job so that functional tests are run on multi-node setup.
Change-Id: I16906c2fb4ff71f0b4ddc42010182a0203c75231