Revert "Full Juju Charm support"
[osm/SO.git] / rwlaunchpad / plugins / rwpkgmgr / rift / tasklets / rwpkgmgr / proxy / base.py
1 #
2 # Copyright 2016 RIFT.IO Inc
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # Author(s): Varun Prasad
17 # Creation Date: 09/25/2016
18 #
19
20
21 import abc
22 import asyncio
23
24
25 class AbstractPackageManagerProxy():
26 """Proxy interface that need to be implemented by the package store
27 """
28 @abc.abstractmethod
29 @asyncio.coroutine
30 def endpoint(self, package_type, package_id):
31 """Rest based endpoint to reveal the package contents
32
33 Args:
34 package_type (str): NSD, VNFD
35 package_id (str) ID
36
37 Returns:
38 str: URL of the endpoint
39
40 """
41 pass
42
43 @abc.abstractmethod
44 @asyncio.coroutine
45 def schema(self, package_type):
46 """Summary
47
48 Args:
49 package_type (str): Type of package (NSD|VNFD)
50
51 Returns:
52 list: List of top level dirs
53
54 """
55 pass
56
57 @abc.abstractmethod
58 @asyncio.coroutine
59 def package_file_add(self, new_file, package_type, package_id, package_path):
60 """Add file to a package
61
62 Args:
63 new_file (str): Path to the new file
64 package_type (str): NSD,VNFD
65 package_id (str): ID
66 package_path (str): relative path into the package.
67
68 Returns:
69 Bool: True, If operation succeeded.
70 """
71 pass
72
73 @abc.abstractmethod
74 @asyncio.coroutine
75 def package_file_delete(self, package_type, package_id, package_path):
76 """delete file from a package
77
78 Args:
79 package_type (str): NSD,VNFD
80 package_id (str): ID
81 package_path (str): relative path into the package.
82
83 Returns:
84 Bool: True, If operation succeeded.
85 """
86 pass