diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/onapsdk/constants.py | 1 | ||||
-rw-r--r-- | src/onapsdk/sdc/sdc_element.py | 2 | ||||
-rw-r--r-- | src/onapsdk/sdc/vendor.py | 16 | ||||
-rw-r--r-- | src/onapsdk/sdc/vsp.py | 19 | ||||
-rw-r--r-- | src/onapsdk/version.py | 2 |
5 files changed, 20 insertions, 20 deletions
diff --git a/src/onapsdk/constants.py b/src/onapsdk/constants.py index 11bd03b..98d7af6 100644 --- a/src/onapsdk/constants.py +++ b/src/onapsdk/constants.py @@ -32,6 +32,7 @@ UNDER_CERTIFICATION = "Certification in progress" CHECKED_IN = "Checked In" SUBMITTED = "Submitted" DISTRIBUTED = "Distributed" +ARCHIVED = "ARCHIVED" ## # Actions ## diff --git a/src/onapsdk/sdc/sdc_element.py b/src/onapsdk/sdc/sdc_element.py index 9273861..8fd8da1 100644 --- a/src/onapsdk/sdc/sdc_element.py +++ b/src/onapsdk/sdc/sdc_element.py @@ -144,6 +144,8 @@ class SdcElement(SdcOnboardable, ABC): str: the URL to use """ + if action_type == const.ARCHIVE: + version_path = version_path.split("/")[0] return "{}/{}/{}/actions".format(base, subpath, version_path) @classmethod diff --git a/src/onapsdk/sdc/vendor.py b/src/onapsdk/sdc/vendor.py index a82e3b9..0618a4f 100644 --- a/src/onapsdk/sdc/vendor.py +++ b/src/onapsdk/sdc/vendor.py @@ -46,6 +46,17 @@ class Vendor(SdcElement): super().__init__() self.name: str = name or "Generic-Vendor" + @classmethod + def _get_all_url(cls) -> str: + """ + Get URL for all elements in SDC. + + Returns: + str: the url + + """ + return f"{cls._base_url()}/items?itemType=vlm" + def onboard(self) -> None: """Onboard the vendor in SDC.""" if not self.status: @@ -106,3 +117,8 @@ class Vendor(SdcElement): def _sdc_path(cls) -> None: """Give back the end of SDC path.""" return cls.VENDOR_PATH + + def archive(self) -> None: + """Archive Vendor.""" + self._action_to_sdc(const.ARCHIVE, action_type=const.ARCHIVE) + self._status = const.ARCHIVED diff --git a/src/onapsdk/sdc/vsp.py b/src/onapsdk/sdc/vsp.py index a04b3c0..3100647 100644 --- a/src/onapsdk/sdc/vsp.py +++ b/src/onapsdk/sdc/vsp.py @@ -340,25 +340,6 @@ class Vsp(SdcElement): # pylint: disable=too-many-instance-attributes """ return f"{cls._base_url()}/items?itemType=vsp" - def _action_url(self, base: str, subpath: str, version_path: str, - action_type: str = None) -> str: - """Generate action URL for VSP to send to SDC. - - Args: - base (str): base part of vsp action url - subpath (str): subpath of vsp action url - version_path (str): version path. If action is equal to ARCHIVE - it's going to be edited - action_type (str, optional): the type of action. - - Returns: - str: the URL to use - - """ - if action_type == const.ARCHIVE: - version_path = version_path.split("/")[0] - return super()._action_url(base, subpath, version_path, action_type) - @classmethod def import_from_sdc(cls, values: Dict[str, Any]) -> 'Vsp': """ diff --git a/src/onapsdk/version.py b/src/onapsdk/version.py index d47a213..07e058e 100644 --- a/src/onapsdk/version.py +++ b/src/onapsdk/version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "10.4.1" +__version__ = "10.4.2" |