blob: e59a73e132cb8bd0d9a27b7ce1999a3853c8909b [file] [log] [blame]
Khen Nursimulua7b842a2016-12-03 23:28:42 -05001#!/usr/bin/env python
2#
3# Copyright 2016 the original author or authors.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18class Constants:
19
20 SSH_SUBSYSTEM = "netconf"
21
22 # Secure credentials directories
23 # TODO: In a production environment these locations require better
24 # protection. For now the user_passwords file is just a plain text file.
25 KEYS_DIRECTORY = 'security/keys'
26 CERTS_DIRECTORY = 'security/certificates'
27 CLIENT_CRED_DIRECTORY = 'security/client_credentials'
28
29 # Datastores
30 RUNNING = "running"
31 CANDIDATE = "candidate"
32 STARTUP = "startup"
33
34 # RPC - base netconf
35 GET = "get"
36 GET_CONFIG = "get-config"
37 COPY_CONFIG = "copy-config"
38 EDIT_CONFIG = "edit-config"
39 DELETE_CONFIG = "delete-config"
40 LOCK = "lock"
41 UNLOCK = "unlock"
42 CLOSE_SESSION = "close-session"
43 KILL_SESSION = "kill-session"
44
45 # Operations
46 OPERATION = "operation"
47 DEFAULT_OPERATION = "default-operation"
48 MERGE = "merge"
49 REPLACE = "replace"
50 CREATE = "create"
51 DELETE = "delete"
52 NONE = "none"
53
54 # Netconf namespaces
55 NETCONF_BASE_10 = "urn:ietf:params:netconf:base:1.0"
56 NETCONF_BASE_11 = "urn:ietf:params:netconf:base:1.1"
Khen Nursimulua4972742016-12-23 17:15:20 -050057 NETCONF_MONITORING = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050058
59 # XML
60 XML_HEADER = """<?xml version="1.0" encoding="utf-8"?>"""
61
62 # Capability xpath
63 CAPABILITY_XPATH = "//nc:hello/nc:capabilities/nc:capability"
64 RPC_XPATH = "/nc:rpc"
65
66 NC_SOURCE="nc:source"
67 SOURCE = "source"
68 TARGET = "target"
69 CONFIG = "config"
70
71
72 TEST_OPTION = "test-option"
73 TEST_THEN_SET = "test-then-set"
74 SET = "set"
75
76 ERROR_OPTION = "error-option"
77 STOP_ON_ERROR = "stop-on-error"
78 CONTINUE_ON_ERROR = "continue-on-error"
79 ROLLBACK_ON_ERROR = "rollback-on-error"
80
81 #tags
82 NC = "nc"
83 RPC = "rpc"
84 RPC_REPLY = "rpc-reply"
85 RPC_ERROR = "rpc-error"
86 CAPABILITY = "capability"
87 CAPABILITIES = "capabilities"
88 HELLO = "hello"
89 URL = "url"
90 NC_FILTER="nc:filter"
91 FILTER = "filter"
92 SUBTREE = "subtree"
93 XPATH = "xpath"
94 OK = "ok"
95 SESSION_ID = "session-id"
96 MESSAGE_ID = "message-id"
97 XMLNS = "xmlns"
98 DELIMITER = "]]>]]>"