blob: 9733327637d47b6ad2ac7288889e1aa34125c0a8 [file] [log] [blame]
Khen Nursimulua7b842a2016-12-03 23:28:42 -05001#!/usr/bin/env python
2#
Khen Nursimuluc9ef7c12017-01-04 20:40:53 -05003# Copyright 2017 the original author or authors.
Khen Nursimulua7b842a2016-12-03 23:28:42 -05004#
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:
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050019 SSH_SUBSYSTEM = "netconf"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050020
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050021 # Send message max size
22 MAXSSHBUF = 1024 * 1024
Khen Nursimulua7b842a2016-12-03 23:28:42 -050023
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050024 # Secure credentials directories
25 # TODO: In a production environment these locations require better
26 # protection. For now the user_passwords file is just a plain text file.
27 KEYS_DIRECTORY = 'security/keys'
28 CERTS_DIRECTORY = 'security/certificates'
29 CLIENT_CRED_DIRECTORY = 'security/client_credentials'
Khen Nursimuluc9ef7c12017-01-04 20:40:53 -050030
Khen Nursimulu3676b7c2017-01-31 13:48:38 -050031 # YANG message definition file - generated file
Khen Nursimulu2e6f5952017-02-21 15:14:20 -050032 YANG_MESSAGE_DEFINITIONS_FILE = 'yang_message_defs.py'
Khen Nursimulu3676b7c2017-01-31 13:48:38 -050033
Khen Nursimulu0b9aed12017-02-06 15:33:46 -050034 # Generated YANG schemas to ignore as not used by Netconf client
Khen Nursimulu2e6f5952017-02-21 15:14:20 -050035 SCHEMAS_TO_IGNORE = ['http.yang', 'yang_options.yang', 'descriptor.yang']
Khen Nursimulu0b9aed12017-02-06 15:33:46 -050036
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050037 # Datastores
38 RUNNING = "running"
39 CANDIDATE = "candidate"
40 STARTUP = "startup"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050041
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050042 # RPC - base netconf
43 GET = "get"
44 GET_CONFIG = "get-config"
45 COPY_CONFIG = "copy-config"
46 EDIT_CONFIG = "edit-config"
47 DELETE_CONFIG = "delete-config"
48 LOCK = "lock"
49 UNLOCK = "unlock"
50 CLOSE_SESSION = "close-session"
51 KILL_SESSION = "kill-session"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050052
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050053 # Operations
54 OPERATION = "operation"
55 DEFAULT_OPERATION = "default-operation"
56 MERGE = "merge"
57 REPLACE = "replace"
58 CREATE = "create"
59 DELETE = "delete"
60 NONE = "none"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050061
62 # Netconf namespaces
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050063 NETCONF_BASE_10 = "urn:ietf:params:netconf:base:1.0"
64 NETCONF_BASE_11 = "urn:ietf:params:netconf:base:1.1"
65 NETCONF_MONITORING = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"
66 NETCONF_WRITABLE = "urn:ietf:params:netconf:capability:writable-running:1.0"
Khen Nursimulu2e6f5952017-02-21 15:14:20 -050067 NETCONF_CANDIDATE = "urn:ietf:params:netconf:capability:candidate:1.0"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050068
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050069 # XML
70 XML_HEADER = """<?xml version="1.0" encoding="utf-8"?>"""
Khen Nursimulua7b842a2016-12-03 23:28:42 -050071
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050072 # Capability xpath
73 CAPABILITY_XPATH = "//nc:hello/nc:capabilities/nc:capability"
74 RPC_XPATH = "/nc:rpc"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050075
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050076 NC_SOURCE = "nc:source"
77 SOURCE = "source"
78 TARGET = "target"
79 CONFIG = "config"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050080
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050081 TEST_OPTION = "test-option"
82 TEST_THEN_SET = "test-then-set"
83 SET = "set"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050084
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050085 ERROR_OPTION = "error-option"
86 STOP_ON_ERROR = "stop-on-error"
87 CONTINUE_ON_ERROR = "continue-on-error"
88 ROLLBACK_ON_ERROR = "rollback-on-error"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050089
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050090 # tags
91 NC = "nc"
92 VOLTHA = 'voltha'
93 HEALTH = 'health'
94 NCM = "ncm"
95 RPC = "rpc"
96 RPC_REPLY = "rpc-reply"
97 RPC_ERROR = "rpc-error"
98 CAPABILITY = "capability"
99 CAPABILITIES = "capabilities"
100 HELLO = "hello"
101 URL = "url"
102 NC_FILTER = "nc:filter"
103 FILTER = "filter"
104 SUBTREE = "subtree"
105 XPATH = "xpath"
106 OK = "ok"
107 SESSION_ID = "session-id"
108 MESSAGE_ID = "message-id"
109 XMLNS = "xmlns"
110 DELIMITER = "]]>]]>"
Khen Nursimulu2e6f5952017-02-21 15:14:20 -0500111 DELIMITER_1_1 = "##"
Khen Nursimuluc9ef7c12017-01-04 20:40:53 -0500112
Khen Nursimulu8ffb8932017-01-26 13:40:49 -0500113 NS_MAP = {
114 'nc': 'urn:ietf:params:xml:ns:netconf:base:1.0',
Khen Nursimulu0b9aed12017-02-06 15:33:46 -0500115 'voltha': 'urn:opencord:params:xml:ns:voltha:voltha',
Khen Nursimulu8ffb8932017-01-26 13:40:49 -0500116 'ncm': 'urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring',
Khen Nursimulu0b9aed12017-02-06 15:33:46 -0500117 'health': 'urn:opencord:params:xml:ns:voltha:health'
Khen Nursimulu8ffb8932017-01-26 13:40:49 -0500118 }