Revision 94803aaf ncclient/operations/edit.py

b/ncclient/operations/edit.py
12 12
# See the License for the specific language governing permissions and
13 13
# limitations under the License.
14 14

  
15
from rpc import RPC
15
from ncclient.rpc import RPC
16 16

  
17 17
# TODO
18 18

  
......
25 25
'''
26 26

  
27 27
class EditConfig(RPC):
28
    pass
28
    
29
    SPEC = {
30
        'tag': 'edit-config',
31
        'children': [
32
            { 'target': None }
33
        ]
34
    }
35
    
36
    def request(self):
37
        pass
29 38

  
30 39
class CopyConfig(RPC):
31
    pass
40
    
41
    SPEC = {
42
        
43
    }
44
    
45
    def request(self):
46
        pass
32 47

  
33 48
class DeleteConfig(RPC):
34
    pass
49
    
50
    SPEC = {
51
        'tag': 'delete-config',
52
        'children': [
53
            'tag': 'target',
54
            'children': {'tag': None }
55
        ]
56
    }
57
    
58
    def request(self, target=None, targeturl=None):
59
        spec = deepcopy(DeleteConfig.SPEC)
60
        
35 61

  
36 62
class Validate(RPC):
37
    pass
63
    
64
    DEPENDS = ['urn:ietf:params:netconf:capability:validate:1.0']
65
    SPEC = {}
66
    
67
    def request(self):
68
        pass
69

  
38 70

  
39 71
class Commit(RPC):
40
    pass # .confirm() !
72
    
73
    SPEC = {'tag': 'commit'}
74
    
75
    def request(self):
76
        return self._request(Commit.SPEC)
77

  
41 78

  
42 79
class DiscardChanges(RPC):
43
    pass
80
    
81
    DEPENDS = ['urn:ietf:params:netconf:capability:candidate:1.0']
82
    SPEC = {'tag': 'discard-changes'}
83
    
84
    def request(self):
85
        return self._request(DiscardChanges.SPEC)

Also available in: Unified diff