blob: b45363feeaaa355b080bb0617332590ee9259ce7 [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
32 YANG_MESSAGE_DEFINITIONS_FILE='yang_message_defs.py'
33
Khen Nursimulu0b9aed12017-02-06 15:33:46 -050034 # Generated YANG schemas to ignore as not used by Netconf client
35 SCHEMAS_TO_IGNORE =['http.yang', 'yang_options.yang', 'descriptor.yang']
36
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 Nursimulua7b842a2016-12-03 23:28:42 -050067
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050068 # XML
69 XML_HEADER = """<?xml version="1.0" encoding="utf-8"?>"""
Khen Nursimulua7b842a2016-12-03 23:28:42 -050070
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050071 # Capability xpath
72 CAPABILITY_XPATH = "//nc:hello/nc:capabilities/nc:capability"
73 RPC_XPATH = "/nc:rpc"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050074
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050075 NC_SOURCE = "nc:source"
76 SOURCE = "source"
77 TARGET = "target"
78 CONFIG = "config"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050079
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050080 TEST_OPTION = "test-option"
81 TEST_THEN_SET = "test-then-set"
82 SET = "set"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050083
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050084 ERROR_OPTION = "error-option"
85 STOP_ON_ERROR = "stop-on-error"
86 CONTINUE_ON_ERROR = "continue-on-error"
87 ROLLBACK_ON_ERROR = "rollback-on-error"
Khen Nursimulua7b842a2016-12-03 23:28:42 -050088
Khen Nursimulu8ffb8932017-01-26 13:40:49 -050089 # tags
90 NC = "nc"
91 VOLTHA = 'voltha'
92 HEALTH = 'health'
93 NCM = "ncm"
94 RPC = "rpc"
95 RPC_REPLY = "rpc-reply"
96 RPC_ERROR = "rpc-error"
97 CAPABILITY = "capability"
98 CAPABILITIES = "capabilities"
99 HELLO = "hello"
100 URL = "url"
101 NC_FILTER = "nc:filter"
102 FILTER = "filter"
103 SUBTREE = "subtree"
104 XPATH = "xpath"
105 OK = "ok"
106 SESSION_ID = "session-id"
107 MESSAGE_ID = "message-id"
108 XMLNS = "xmlns"
109 DELIMITER = "]]>]]>"
Khen Nursimuluc9ef7c12017-01-04 20:40:53 -0500110
Khen Nursimulu8ffb8932017-01-26 13:40:49 -0500111 NS_MAP = {
112 'nc': 'urn:ietf:params:xml:ns:netconf:base:1.0',
Khen Nursimulu0b9aed12017-02-06 15:33:46 -0500113 'voltha': 'urn:opencord:params:xml:ns:voltha:voltha',
Khen Nursimulu8ffb8932017-01-26 13:40:49 -0500114 'ncm': 'urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring',
Khen Nursimulu0b9aed12017-02-06 15:33:46 -0500115 'health': 'urn:opencord:params:xml:ns:voltha:health'
Khen Nursimulu8ffb8932017-01-26 13:40:49 -0500116 }