Commit Graph

321 Commits

Author SHA1 Message Date
Zuul 804d179af6 Merge "Fix the handling of content-type in HTTPClient" 2024-03-01 10:43:01 +00:00
Kaori Mitani 0bae79f913 Fix output regarding PM Job response
According to SOL003, "authentication" should not appear
in the PmJobModifications response.
Therefore, it has been removed from the output obtained
when running "openstack vnfpm job update".

Closes-Bug: #2054420
Change-Id: I14b415a161983e682a4415d11d1fdad5792be3f8
2024-02-22 09:29:32 +00:00
Ayumu Ueha a2406d9510 Fix the handling of content-type in HTTPClient
If content-type other than application/json is used, an error occur
because the processing is lacked in HTTPClient to pass content-type.
So, this patch fixes the handling of `content-type` in HTTPClient.

Closes-Bug: #2052768
Change-Id: Ief823dbdec9cceea3c7129860381b9ab34d0e438
2024-02-09 11:08:56 +00:00
Ayumu Ueha e1cd39fa41 Obsolete Legacy APIs excluding VIM feature
This patch obsoletes CLI for Legacy APIs excluding VIM feature.

Implements: blueprint deprecate-legacy-apis
Change-Id: I9be376a660c6f7c34c0abe7e327dec7a91d49ee2
2023-12-08 02:29:05 +00:00
Ayumu Ueha 4978e7db51 Fix unit test error caused by cliff upgrade
This patch fixes the following issue of unit test that caused by
upgraded version of cliff library to v4.4.0.

-----
AttributeError: 'FakeStdout' object has no attribute 'isatty'
-----

Change-Id: I77438314f8cf98e62155b1e43da3484cd5f1f514
2023-11-17 04:37:28 +00:00
Zuul e5bd58ffe1 Merge "Extends unit test code support for merged patch" 2023-02-17 05:07:40 +00:00
Zuul 2add9e0f85 Merge "Fix list VNF/Subscription UT error" 2023-02-17 04:39:07 +00:00
Ai Hamano a41323dc1d Fix list VNF/Subscription UT error
This patch resolves the following error caused by using one data in
multiple tests.
-----
ft1.2: tackerclient.tests.unit.osc.v1.test_vnflcm_subsc.
TestListLccnSubscription.test_take_action_with_
paginationtesttools.testresult.real._StringException:
 Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/
python-tackerclient/tackerclient/tests/unit/osc/v1
/test_vnflcm_subsc.py", line 139, in test_take_action_with_
pagination
    expected_data.append(vnflcm_subsc_fakes.get_subscription_
data(
  File "/home/zuul/src/opendev.org/openstack
/python-tackerclient/tackerclient/tests/unit/osc/v1
/vnflcm_subsc_fakes.py", line 166, in get_subscription_data
    subscription.pop(item)
KeyError: 'filter'
-----

Add test data for each test.
(Three data are set for each test data so that the first, last, and
other values can be checked.)
And change not to modify test data directly in get method.

Closes-Bug: #2007524
Change-Id: Id3919fc638f6b858c115a3a7d7e4ca60036217d4
2023-02-17 02:25:25 +00:00
Zuul a4e0790e75 Merge "Extra param for OpenStack type when register vim" 2023-02-16 12:07:03 +00:00
Zuul 0f9b6f5c52 Merge "Add support cnf auto scale via threshold interface" 2023-02-16 10:32:17 +00:00
kexuesheng e398f422a8 Extra param for OpenStack type when register vim
This patch changes to allow setting the `extra` parameter in the VIM
configuration for openstack vim type.

Implements: blueprint enhance-api-policy
Change-Id: I37a3e21afced0aae6e0fd3c0cbb28ab16f2b7df8
2023-02-16 11:07:39 +09:00
Yi Feng 8b45c8082b Add support cnf auto scale via threshold interface
Add the Performance Management Threshold CLI to support AutoScale.
The Performance Management Threshold API is based on ETSI NFV-SOL
002 v3.3.1 and ETSI NFV-SOL 003 v3.3.1, which is Version "2.0.0"
API of Tacker.

Implements: blueprint support-auto-lcm
Change-Id: Idd313d6abe47dfa41fc86ddc614d00f99f3fc3b2
2023-02-16 10:36:47 +09:00
psingla 6b168365d6 Extends unit test code support for merged patch
This patch extends unit test code for the
feature which is implemented in this patch
https://review.opendev.org/c/openstack/python-tackerclient/+/847746

Implements: blueprint paging-query-result
Change-Id: Ic1c23ee51ab838168577c60a3ac44b600bca2563
2023-02-15 05:49:53 +00:00
Ayumu Ueha 156deea66c Add deprecation notice for Legacy APIs
This patch deprecates CLI for Legacy APIs excluding VIM feature.

Implements: blueprint deprecate-legacy-apis
Change-Id: Ib74db43b4a3de4676e61f4f9ce6d3d2095a11ddf
2023-01-27 00:38:21 +00:00
Koji Shimizu 64d7a87670 Add support cnf auto heal and scale
Support container based VNF AutoHeal and AutoScale operation with
External Monitoring Tools.

Add the Fault Management interfaces and CLI to support AutoHeal.
Add the Performance Management interfaces and CLI to support
AutoScale. The Fault Management and Performance Management
interfaces are based on ETSI NFV-SOL 002 v3.3.1 and ETSI NFV-SOL
003 v3.3.1, which are Version "2.0.0" API of Tacker. Add the
Prometheus Plugin that has a interface between tacker and the
External Monitoring Tool.

Implements: blueprint support-auto-lcm
Change-Id: I7023a72b73f17f3746c74d311919497c7c4e8b3f
2022-09-01 12:16:57 +00:00
Zuul 3da27cc89a Merge "Support listing all records at once with paging" 2022-09-01 01:03:51 +00:00
Koichi Edagawa 06750997e6 Support listing all records at once with paging
This patch enables you to receive all records for target list
commands at once even if Tacker's server paginates them.

Target commands are below.

 - openstack vnflcm list
 - openstack vnflcm op list
 - openstack vnflcm subsc list

* As for the following command, it will be supported after
  implementing pagination feature in Tacker's server.

 - openstack vnf package list

Implements: blueprint paging-query-result
Change-Id: I8e5c9bdd99b9c1e45aef8aa1e74bdbbfdd7c5c89
2022-08-31 17:18:24 +09:00
Hideki Matsuda fa4a66858e Support for 'extra' parameters for vim register
If the `extra` parameter is present in the config-file specified
when the 'openstack vim register' command is executed,
the data is sent to the tacker.

Implements: blueprint remove-cnf-restriction
Change-Id: I13420945f7d4f81f48a5be7f8f92a0635fbef18a
2022-08-30 10:56:39 +00:00
Zuul bfc0c8fdeb Merge "Add OpenID Connect Token Auth for k8s" 2022-08-25 09:36:16 +00:00
Yi Feng 0fcb9a59a1 Add OpenID Connect Token Auth for k8s
This patch adds openid auth info settings support when calling
vim register/update.

Implements: blueprint support-openid-k8s-vim
Change-Id: Id267050ac7adb349f562477dfc7aa6a53188b4cc
2022-08-18 12:26:30 +09:00
Ai Hamano 21f60be225 Add vnflcm subscriptions APIs
This patch supports CLI of vnflcm subscriptions APIs.

They are as follows.
* vnflcm subsc create
* vnflcm subsc delete
* vnflcm subsc list
* vnflcm subsc show

The output message of "vnflcm delete" was also modified
to match "vnflcm subsc delete".

Implements: blueprint support-nfv-solv3-subscriptions
Implements: blueprint support-etsi-nfv-specs
Change-Id: I9a839a3d131afc80fec0c2bbaa30443798117e0d
2022-07-21 14:56:56 +09:00
Zuul 417f27b9b8 Merge "Support ChangeVNFPackage command in tackerclient" 2022-02-25 02:32:22 +00:00
Yi Feng ab901b6466 Support ChangeVNFPackage command in tackerclient
Add ``openstack vnflcm change_vnfpkg`` to python-tackerclient. This
command can execute change current vnf package operation [1].

[1]
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_NFV-SOL003v030301p.pdf

Implements: blueprint upgrade-vnf-package
Change-Id: I0d9c88147dee3a273cb27224db6be6c91cf7fe55
2022-02-25 09:51:40 +09:00
Itsuro Oda 3724240344 Add vnflcm v2 APIs
This patch supports CLI of vnflcm v2 APIs which are added in Yoga
release.

They are as follows.
* vnflcm update
* vnflcm scale
* vnflcm heal
* vnflcm change-ext-conn
* vnflcm op fail
* vnflcm op retry
* vnflcm op rollback

They are common with v1 except heal. An optional parameter
'--additional-param-file' is added to heal CLI.

Implements: blueprint support-nfv-solv3-heal-vnf
Implements: blueprint support-nfv-solv3-change-external-connectivity
Implements: blueprint support-nfv-solv3-modify-vnf
Implements: blueprint support-nfv-solv3-scale-vnf
Implements: blueprint support-nfv-solv3-error-handling
Change-Id: If4acd9c4d35ce7a5bf6c23db1a8238654d536c87
2022-02-22 03:01:25 +00:00
Zuul 45412f63f0 Merge "Help message of heal cli modified" 2022-02-22 00:09:08 +00:00
Pooja Singla cc73d9d099 Help message of heal cli modified
Usage message of all cli commands of tacker is constructed by
argument parser by default. It includes optional parameter
first and insert mandatory parameter at end.

All cli commands are implemented with this design only
except heal cli.

Heal cli is a special case in which optional parameter is
coming at end and mandatory parameter is coming before optional.
To fix this issue usage parameter of argument parser is set
in heal cli.

Closes-Bug: #1954744

Change-Id: I3b1d04df210ad07d4b9a99f300017d49e2b56f0b
2022-02-18 16:37:12 +05:30
Renu 1c73f54664 Fix in "vnflcm op list" CLI with exclude-fields
"vnflcm op list" with "--exclude-fields" is not
excluding parameters from CLI result.

Closes-Bug: 1953377
Change-Id: If47beccfbab4b85173bbe159905d0605e721cedd
2022-01-27 04:53:39 +00:00
Zuul ccda0487d7 Merge "Support of Cancel VNF command in openstackclient" 2021-12-13 18:35:34 +00:00
Hiromu Asahina 6834454309 Support of Cancel VNF command in openstackclient
Add ``openstack vnflcm op cancel`` to python-tackerclient. This
command can execute Cancel operation [1]. This API makes a transition a
LCM that is stopped in the PROCESSING state to the FAILED_TEMP state.

[1]
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_NFV-SOL003v030301p.pdf

Implements: blueprint support-cancel
Change-Id: Id957f6a7992f9fd5b04806aff3d76680d8d63a8d
Signed-off-by: Hiromu Asahina <hiromu.asahina.az@hco.ntt.co.jp>
2021-12-10 18:09:33 +09:00
Itsuro Oda 98789f8f9a Multi version API support
Add version '2' for support version of --os-tacker-api-version to
'openstack vnflcm' CLI.

If '--os-tacker-api-version 2' is specified, REST API url
'/vnflcm/v2' is used instead of '/vnflcm/v1'.

New CLI 'openstack vnflcm versions' is added too.

Implements: blueprint multi-version-api
Change-Id: I256a4010043d0b84ffe43b055c6a6a67a2d5d661
2021-08-31 22:24:52 +00:00
Javier Pena 6325127c03 Remove use of testtools.helpers.safe_hasattr
The testtools package removed safe_hasattr in version 2.5.0 [1].
Since it is only used in two unit tests, let's replace it with the
built-in hasattr.

[1] - https://github.com/testing-cabal/testtools/blob/2.5.0/NEWS#L31-L34

Change-Id: I57be2d06efe8913805069150bd3f884322a78a42
2021-08-05 09:42:01 +02:00
Manpreet Kaur 94e28fc28f Correct YAML load warning
The use of `yaml.load` without Loader is deprecated and
considered unsafe.

The warning notice:
/opt/stack/python-tackerclient/tackerclient/tacker/v1_0/nfvo/vim.py:
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated,
as the default Loader is unsafe.
Please read https://msg.pyyaml.org/load for full details.
config_param = yaml.load(config_yaml)

This change adds (Loader=yaml.SafeLoader) to remove the warning.

Change-Id: Idc77d855b41801777d57cfe92d1c448b6e72feaa
2021-07-02 20:44:45 +05:30
Renu c20ef24533 vnfConfigurableProperties missing in VNF show
This patch will resolve this issue and display the parameter
vnfConfigurableProperties in Query VNF. This parameter will be visible
in output of CLI like "openstack vnflcm show".

Closes-Bug: #1930571
Change-Id: I67b9bf854000ae52d2e1df40e4edf437713162b5
2021-06-21 12:08:55 +00:00
yatinkarel b5603cc45c Use assertCountEqual instead of assertItemsEqual
The assertItemsEqual method has been removed in Python 3.3 [1] but
it was kept alive by unittest2, imported by testtools. For better
compatibility, change to assertCountEqual.

[1] https://bugs.python.org/issue17866

Change-Id: Iea76915f25eb2e505750d509bdd06758afe324de
2021-05-13 11:27:27 +05:30
Nguyen Hai 785c6dbfda Adds support force delete VNFFG
This patch adds '--force' parameter to vnffg delete command,
to force delete VNFFG.

e.g: openstack vnf graph delete --force VNFFG1

blueprint force-delete-resources

Change-Id: I642ddcdb7a1167f25553ef26df6102bb2be22c3f
2021-04-07 02:12:24 +00:00
Manpreet Kaur 124be387dc Fix failing UT in TestListVnfLcmOp
The unit test 'tackerclient.tests.unit.osc.v1.test_vnflcm_op_occs.
TestListVnfLcmOp.test_take_action_with_filter' is failing with below
error message,
DEBUG: TypeError: Object of type 'FormatComplexDataColumn' is not
JSON serializable

Background:
In class TestListVnfLcmOp definition, "create_vnflcm_op_occs" function
is called and list of fake vnflcm op occs dictionary is store in
vnflcm_op_occs_obj.
Now this dictionary is used in two unit test cases "test_take_action"
and "test_take_action_with_filter".
In order to evaluate test results, in "test_take_action" test case,
"get_vnflcm_op_occ_data" function is called using "vnflcm_op_occs_obj"
which appends the data in dictionary.

Later this dictionary "vnflcm_op_occs_obj" is again used in
"test_take_action_with_filter".

Implementation:
This patch creates a separate list of fake vnflcm op occs dictionary for
both the test cases.

This issue has been impacting below reviews as well,
[1] https://review.opendev.org/c/openstack/python-tackerclient/+/636893
[2] https://review.opendev.org/c/openstack/python-tackerclient/+/781314

Closes-Bug: #1919350
Change-Id: I0d62f77cf5d1e9ec0b0a7c404abab83f97b708ba
2021-03-26 11:54:31 +05:30
Aldinson Esto 4e6dc4c031 CLI for Individual VNF LCM Operation Occurrence
Add ``openstack vnflcm op show <vnf-lcm-op-occ-id>``
to python-tackerclient. This command can execute the
get Individual VNF LCM Operation Occurrence by
specifying vnf-lcm-op-occ-id as parameter.

Implements: blueprint support-fundamental-lcm
https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-fundamental-vnf-lcm-based-on-ETSI-NFV.html
Change-Id: Ibd24a2aa3ec90fbca4caabbcfb3c8a3883e4eae8
2021-03-11 09:54:10 +09:00
Aldinson Esto 6b29bb78b1 Support CLI for Getting List of VNF LCM Operation Occurrences
Add ``openstack vnflcm op list`` to python-tackerclient.
This command can execute getting the list of VNF LCM
Operation Occurrences. User can specify filters for more
specific results.

Note:
- Filtering for the following attributes:
  operationParams, error, resourceChanges and
  changedInfo is only limited to the parent
  attribute. Currently, child attributes/nested
  attributes are not searchable.

Implements: blueprint support-fundamental-lcm
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-fundamental-vnf-lcm-based-on-ETSI-NFV.html
Change-Id: Ie0b3399946d2a705011269025102d9380102ca92
2021-03-10 22:24:11 +09:00
Wataru Juso 1299e15f35 Support of Retry VNF command in openstackclient
Add ``openstack vnflcm op retry`` to python-tackerclient.
This command can execute Retry operation.
This API re-executes an LCM that is stopped in the FAILED_TEMP state
from where it was interrupted.

Implements: blueprint support-error-handling
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-error-handling-based-on-ETSI-NFV.html
Change-Id: I6731d0bcbcd5a4e597596e63c2cd883b3897a145
2021-03-10 11:14:11 +09:00
Wataru Juso cfe14110d1 Support CLI of Change External VNF Connectivity
Add ``openstack vnflcm op chg-ext-conn`` to python-tackerclient.
This command can execute Change external VNF Connectivity operation.
This API can change VL setting.

Implements: blueprint support-change-external-connectivity
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-change-external-VNF-connectivity-operation.html
Change-Id: I3a935296646361032665082a4060bc21ff51c1b1
2021-03-10 09:54:49 +09:00
Wataru Juso 58167535c7 Support of Fail VNF command in openstackclient
Add ``openstack vnflcm op fail`` to python-tackerclient.
This command can execute Fail operation.
The API can change operationStatus from "FAILED_TEMP" to "FAILED".

Implements: blueprint support-error-handling
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-error-handling-based-on-ETSI-NFV.html
Change-Id: I83395e159e28c7e831dfe0ecd90435b3fb18c196
2021-03-08 09:26:29 +09:00
Zuul b7968d815e Merge "Fix error message for nonexistent vnf package" 2021-03-05 06:56:21 +00:00
Manpreet Kaur e7a0c96920 Fix error message for nonexistent vnf package
In Victoria release, the error handling of non-existing VNF package
was modified, please refer to [1].
On passing a non-existing vnf package uuid to "vnf package upload"
command, the tacker server sends an HTTP response with "Content-Type"
header as "application/problem+json" and the reason for a failure
described in the JSON problem details object.

This patch extracts the ETSI error message in method
exception_handler_v10.

Fixes the issue and now it will output below error message:

  $ openstack vnf package upload --path sample_vnf_pkg.zip dummy-id
  Can not find requested vnf package: dummy-id

Note: This bug was earlier address in Ussuri release, please refer [2].

[1] https://review.opendev.org/c/openstack/tacker/+/747678/37/tacker/api/vnfpkgm/v1/controller.py
[2] https://review.opendev.org/c/openstack/python-tackerclient/+/688886

Co-Authored-By: Wataru Juso  w-juso@nec.com
Closes-Bug: #1847726
Change-Id: I25e1bdc32e0b91bbe02b82f79918c02b98e5f110
2021-03-03 08:03:26 +05:30
zhangboye 68df82918a Dropping explicit unicode literal
In python 3, all strings are considered as unicode string.

This patch drops the explicit unicode literal (u'...')
or (u"..") appearances from the unicode strings.

Note: The scope of the patch is to drop unicode literal prefix
from python source code files, documentation and comment are overlook.

Co-Authored-By: Manpreet Kaur kaurmanpreet2620@gmail.com
Change-Id: I5316037871109838a03ff4561b7b38dcc56bc447
2021-02-26 10:41:44 +05:30
Wataru Juso bbe6d2c7e0 Modify operation of scale parameters
Scale command cannot be executed without '--additional-param-file'
option, because there is a problem with branch process. Modify branch
process when using this parameter.

And, I uniform cardinality mismatches of specification definition [1]
in some arguments are resolved. This change has no impact of the order
of setting.

[1]https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-scale-api-based-on-etsi-nfv-sol.html

Closes-Bug: #1903280
Change-Id: I1dd2c71760112982abd2b4b7da6dbaafd7077614
2021-01-05 14:48:27 +09:00
Yasufumi Ogawa 754f6df5a7 Drop six support
This update is to drop all of six support to move

Closes-bug: #1900389

Change-Id: Ia6c61751203e98d432344dc9a52fe65bdb062af0
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
2020-11-01 18:43:00 +00:00
Zuul 727493c7bf Merge "Remove six.moves.urllib" 2020-10-31 16:02:38 +00:00
LiangLu 6bdb64f464 Modify the description of the command --help
The description of the "openstack vnf package artifact download --help"
command is incorrect.Modify VNF Package or VNFD data to VNF Package
artifact file data.

Change-Id: Ib70efb7eefdb6eacea24dec67bb4ff996b6178d3
Closes-Bug: #1901103
2020-10-28 02:54:27 -04:00
wangzihao 97f0903242 Remove six.moves.urllib
Remove six.moves.urllib replace with python3 urllib.

Change-Id: Ifd9d1dadfdc78ab7ef21bb648f71ca0e62830264
2020-09-23 19:33:29 +08:00
Koichi Edagawa 8ff2f35476 Support of RollbackVNF command in openstackclient
Supported RollbackVNF command in OpenStack Tacker Client.

Co-Authored-By: Yasufumi Ogawa <yasufum.o@gmail.com>
Implements: blueprint support-etsi-nfv-specs
Change-Id: If3d717b487f653ef98196149c4c849ddac69ec95
2020-09-15 18:35:09 +00:00