X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=rwlaunchpad%2Fplugins%2Frwpkgmgr%2Frift%2Ftasklets%2Frwpkgmgr%2Fproxy%2Fbase.py;fp=rwlaunchpad%2Fplugins%2Frwpkgmgr%2Frift%2Ftasklets%2Frwpkgmgr%2Fproxy%2Fbase.py;h=d0a1536dd8c7f889b059bd696cfdf9da4791a0e5;hb=6364d016e7f819903ff29a2ce160cb4cea61bf8f;hp=0000000000000000000000000000000000000000;hpb=c33673480c15d6e64402b547563640b2025a3cd6;p=osm%2FSO.git diff --git a/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/proxy/base.py b/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/proxy/base.py new file mode 100644 index 00000000..d0a1536d --- /dev/null +++ b/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/proxy/base.py @@ -0,0 +1,86 @@ +# +# Copyright 2016 RIFT.IO Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author(s): Varun Prasad +# Creation Date: 09/25/2016 +# + + +import abc +import asyncio + + +class AbstractPackageManagerProxy(): + """Proxy interface that need to be implemented by the package store + """ + @abc.abstractmethod + @asyncio.coroutine + def endpoint(self, package_type, package_id): + """Rest based endpoint to reveal the package contents + + Args: + package_type (str): NSD, VNFD + package_id (str) ID + + Returns: + str: URL of the endpoint + + """ + pass + + @abc.abstractmethod + @asyncio.coroutine + def schema(self, package_type): + """Summary + + Args: + package_type (str): Type of package (NSD|VNFD) + + Returns: + list: List of top level dirs + + """ + pass + + @abc.abstractmethod + @asyncio.coroutine + def package_file_add(self, new_file, package_type, package_id, package_path): + """Add file to a package + + Args: + new_file (str): Path to the new file + package_type (str): NSD,VNFD + package_id (str): ID + package_path (str): relative path into the package. + + Returns: + Bool: True, If operation succeeded. + """ + pass + + @abc.abstractmethod + @asyncio.coroutine + def package_file_delete(self, package_type, package_id, package_path): + """delete file from a package + + Args: + package_type (str): NSD,VNFD + package_id (str): ID + package_path (str): relative path into the package. + + Returns: + Bool: True, If operation succeeded. + """ + pass