Add deprecation notice for Legacy APIs

This patch deprecates CLI for Legacy APIs excluding VIM feature.

Implements: blueprint deprecate-legacy-apis
Change-Id: Ib74db43b4a3de4676e61f4f9ce6d3d2095a11ddf
This commit is contained in:
Ayumu Ueha 2023-01-12 01:59:14 +00:00
parent 82bf387f77
commit 156deea66c
19 changed files with 118 additions and 3 deletions

View File

@ -15,5 +15,10 @@
Event Management commands
=========================
.. warning::
Event Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: nfv event *

View File

@ -11,9 +11,14 @@
License for the specific language governing permissions and limitations
under the License.
==============================================
Network Service Descriptor Management commands
==============================================
===================================
Network Service Management commands
===================================
.. warning::
Network Service Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: ns *

View File

@ -15,5 +15,10 @@
Network Service Descriptor Management commands
==============================================
.. warning::
Network Service Descriptor Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: ns descriptor *

View File

@ -15,5 +15,10 @@
Service Function Chain (SFC) Management commands
================================================
.. warning::
Service Function Chain (SFC) Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf chain *

View File

@ -15,5 +15,10 @@
Flow Classifier Management commands
===================================
.. warning::
Flow Classifier Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf classifier *

View File

@ -15,5 +15,10 @@
VNF Management commands
=======================
.. warning::
VNF Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf *

View File

@ -15,5 +15,10 @@
VNF Descriptor (VNFD) Management commands
=========================================
.. warning::
VNF Descriptor (VNFD) Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf descriptor *

View File

@ -15,5 +15,10 @@
VNF Forwarding Graph (VNFFG) Management commands
================================================
.. warning::
VNF Forwarding Graph (VNFFG) Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf graph *

View File

@ -15,5 +15,10 @@
VNF Forwarding Graph Descriptor (VNFFGD) Management commands
============================================================
.. warning::
VNF Forwarding Graph Descriptor (VNFFGD) Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf graph descriptor *

View File

@ -15,5 +15,10 @@
Network Forwarding Path Management commands
===========================================
.. warning::
Network Forwarding Path Management commands are deprecated
and will be removed in the first major release after the Tacker server
version 9.0.0 (2023.1 Antelope release).
.. autoprogram-cliff:: openstack.tackerclient.v1
:command: vnf network forwarding path *

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
Legacy APIs excluding VIM feature are deprecated and will be removed in the
first major release after the Tacker server version 9.0.0 (2023.1 Antelope
release).

View File

@ -20,6 +20,7 @@
import argparse
import logging
import os
import sys
from oslo_log import versionutils
from oslo_utils import encodeutils
@ -183,3 +184,15 @@ def deprecate_warning(what, as_of, in_favor_of=None, remove_in=1):
versionutils.deprecation_warning(as_of=as_of, what=what,
in_favor_of=in_favor_of,
remove_in=remove_in)
# TODO(ueha): Remove this along with the deprecated commands in the first major
# python-tackerclient release after the Tacker server version 9.0.0 (2023.1
# Antelope release).
def deprecate_legacy_warning():
# NOTE(ueha): versionutils has not support Antelope version yet.
msg = _(
'The Legacy API interface has been deprecated. This command will be '
'removed in the first major release after the Tacker server version '
'9.0.0 (2023.1 Antelope release).')
print(msg, file=sys.stderr)

View File

@ -17,6 +17,7 @@
from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -55,6 +56,7 @@ class ShowEvent(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _EVENT, parsed_args.event)
@ -93,6 +95,7 @@ class ListEvent(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
_params = {}
if parsed_args.id:

View File

@ -20,6 +20,7 @@ from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -133,6 +134,7 @@ class CreateNS(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
ns = client.create_ns(self.args2body(parsed_args))
display_columns, columns = _get_columns(ns[_NS])
@ -174,6 +176,7 @@ class DeleteNS(command.Command):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
failure = False
deleted_ids = []
@ -217,6 +220,7 @@ class ListNS(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
data = client.list_nss()
headers, columns = tacker_osc_utils.get_column_definitions(
@ -240,6 +244,7 @@ class ShowNS(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _NS, parsed_args.ns)

View File

@ -20,6 +20,7 @@ from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -86,6 +87,7 @@ class CreateNSD(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
nsd = client.create_nsd(self.args2body(parsed_args))
display_columns, columns = _get_columns(nsd[_NSD])
@ -111,6 +113,7 @@ class DeleteNSD(command.Command):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
failure = False
deleted_ids = []
@ -159,6 +162,7 @@ class ListNSD(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
data = client.list_nsds()
headers, columns = tacker_osc_utils.get_column_definitions(
@ -182,6 +186,7 @@ class ShowNSD(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _NSD, parsed_args.nsd)
@ -209,6 +214,7 @@ class ShowTemplateNSD(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _NSD, parsed_args.nsd)

View File

@ -20,6 +20,7 @@ from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -169,6 +170,7 @@ class CreateVNFFG(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
vnffg = client.create_vnffg(self.args2body(parsed_args))
display_columns, columns = _get_columns(vnffg[_VNFFG])
@ -206,6 +208,7 @@ class DeleteVNFFG(command.Command):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
failure = False
deleted_ids = []
@ -316,6 +319,7 @@ class UpdateVNFFG(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNFFG, parsed_args.vnffg)
@ -341,6 +345,7 @@ class ListVNFFG(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
data = client.list_vnffgs()
headers, columns = tacker_osc_utils.get_column_definitions(
@ -364,6 +369,7 @@ class ShowVNFFG(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNFFG, parsed_args.vnffg)
@ -387,6 +393,7 @@ class ListNFP(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
_params = {}
if parsed_args.vnffg_id:
@ -423,6 +430,7 @@ class ShowNFP(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _NFP, parsed_args.nfp)
@ -448,6 +456,7 @@ class ListFC(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
_params = {}
if parsed_args.nfp_id:
@ -487,6 +496,7 @@ class ShowFC(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _FC, parsed_args.classifier)
@ -513,6 +523,7 @@ class ListSFC(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
_params = {}
if parsed_args.nfp_id:
@ -550,6 +561,7 @@ class ShowSFC(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _SFC, parsed_args.sfc)

View File

@ -20,6 +20,7 @@ from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -87,6 +88,7 @@ class CreateVNFFGD(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
vnffgd = client.create_vnffgd(self.args2body(parsed_args))
display_columns, columns = _get_columns(vnffgd[_VNFFGD])
@ -110,6 +112,7 @@ class DeleteVNFFGD(command.Command):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
failure = False
deleted_ids = []
@ -158,6 +161,7 @@ class ListVNFFGD(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
data = client.list_vnffgds()
headers, columns = tacker_osc_utils.get_column_definitions(
@ -181,6 +185,7 @@ class ShowVNFFGD(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNFFGD, parsed_args.vnffgd)
@ -205,6 +210,7 @@ class ShowTemplateVNFFGD(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNFFGD, parsed_args.vnffgd)

View File

@ -21,6 +21,7 @@ from osc_lib import utils
from oslo_utils import encodeutils
from tackerclient.common import exceptions
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -170,6 +171,7 @@ class CreateVNF(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
vnf = client.create_vnf(self.args2body(parsed_args))
display_columns, columns = _get_columns(vnf[_VNF])
@ -208,6 +210,7 @@ class DeleteVNF(command.Command):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
failure = False
deleted_ids = []
@ -278,6 +281,7 @@ class ListVNF(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
_params = {}
if parsed_args.vim_id:
@ -317,6 +321,7 @@ class ShowVNF(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNF, parsed_args.vnf)
@ -343,6 +348,7 @@ class ListVNFResources(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNF, parsed_args.vnf)
@ -418,6 +424,7 @@ class UpdateVNF(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNF, parsed_args.vnf)
@ -457,6 +464,7 @@ class ScaleVNF(command.Command):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNF, parsed_args.vnf)

View File

@ -20,6 +20,7 @@ from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.common import utils as tacker_common_utils
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
@ -87,6 +88,7 @@ class CreateVNFD(command.ShowOne):
return body
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
vnfd = client.create_vnfd(self.args2body(parsed_args))
display_columns, columns = _get_columns(vnfd[_VNFD])
@ -112,6 +114,7 @@ class DeleteVNFD(command.Command):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
failure = False
deleted_ids = []
@ -160,6 +163,7 @@ class ListVNFD(command.Lister):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
data = client.list_vnfds()
headers, columns = tacker_osc_utils.get_column_definitions(
@ -183,6 +187,7 @@ class ShowVNFD(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNFD, parsed_args.vnfd)
@ -210,6 +215,7 @@ class ShowTemplateVNFD(command.ShowOne):
return parser
def take_action(self, parsed_args):
tacker_common_utils.deprecate_legacy_warning()
client = self.app.client_manager.tackerclient
obj_id = tackerV10.find_resourceid_by_name_or_id(
client, _VNFD, parsed_args.vnfd)