-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetconf-commands.js
194 lines (182 loc) · 4.33 KB
/
netconf-commands.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/**
* Netconf Command Generator
*
* This modules is used to generate XML-RPC commands into strings. Today this is
* done by simply returning a string. It could be expanded in the future to
* return variations such as adding terse or extensive options.
*
*/
/**
* Send Hello
*
* Sends a hello message to the Netconf server
*
* CLI Command:
* - None
*
* Platforms:
* SRXSME, SRXDC
*
* @return {String} returns hello RPC
*/
exports.sendHello = function() {
var rpc = '<hello><capabilities><capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability><capability>urn:ietf:params:xml:ns:netconf:candidate:1.0</capability><capability>urn:ietf:params:xml:ns:netconf:confirmed-commit:1.0</capability><capability>urn:ietf:params:xml:ns:netconf:validate:1.0</capability><capability>urn:ietf:params:xml:ns:netconf:url:1.0?protocol=http,ftp,file</capability><capability>http://xml.juniper.net/netconf/junos/1.0</capability></capabilities></hello>]]>]]>';
return rpc;
};
/**
* Close Session
*
* Sends a message to close the session
*
* CLI Command:
* - None
*
* Platforms:
* SRXSME, SRXDC
*
* @return {String} returns close RPC
*/
exports.closeSession = function() {
var rpc = '<rpc><close-session/></rpc>]]>]]>';
return rpc;
};
/**
* Get Software Information
*
* Sends a message to gather software version data
*
* CLI Command:
* - >show version
*
* Platforms:
* SRXSME, SRXDC
*
* @return {String} returns software version RPC
*/
exports.getSoftwareInformation = function() {
var rpc = '<rpc><get-software-information></get-software-information></rpc>]]>]]>';
return rpc;
};
/**
* Get Firewall Policies
*
* Sends a message to gather firewall policies
*
* CLI Command:
* - >show version
*
* Platforms:
* SRXSME, SRXDC
*
* @return {String} returns close RPC
*/
exports.getPolicy = function() {
var rpc = '<rpc><get-firewall-policies></get-firewall-policies></rpc>]]>]]>';
return rpc;
};
/**
* Get Chassis Forwarding Information
*
* Sends a message to gather fwdd status
*
* CLI Command:
* - >show chassis forwarding
*
* Platforms:
* SRXSME
*
* @return {String} returns fwdd status RPC
*/
exports.getFwddInformation = function() {
var rpc = '<rpc><get-fwdd-information></get-fwdd-information></rpc>]]>]]>';
return rpc;
};
/**
* Get Software Information
*
* Sends a message to gather information on the route engine
*
* CLI Command:
* - >show chassis route-engine
*
* Platforms:
* SRXSME, SRXDC
*
* @return {String} returns route engine RPC
*/
exports.getRouteEngineInformation = function() {
var rpc = '<rpc><get-route-engine-information></get-route-engine-information></rpc>]]>]]>';
return rpc;
};
/**
* Get Authorization Information
*
* Sends a message to gather users permissions
*
* CLI Command:
* - >show cli authorization
*
* Platforms:
* SRXSME, SRXDC
* @return {String} returns authorization RPC
*/
exports.getAuthorizationInformation = function() {
var rpc = '<rpc><get-authorization-information></get-authorization-information></rpc>]]>]]>';
return rpc;
};
/**
* Get Chassis Inventory
*
* Sends a message to display the hardware in the chassis
*
* CLI Command:
* - >show chassis hardware
*
* @return {String} returns get chassis inventory RPC
*/
exports.getChassisInventory = function() {
var rpc = '<rpc><get-chassis-inventory></get-chassis-inventory></rpc>]]>]]>';
return rpc;
};
/**
* Get Flow Session Information
*
* Sends a message to display the current flow sessions
*
* CLI Command:
* - >show security flow session
*
* @return {String} returns get flow session RPC
*/
exports.getFlowSessionInformation = function() {
var rpc = '<rpc><get-flow-session-information></get-flow-session-information></rpc>]]>]]>';
return rpc;
};
/**
* Configure Private
*
* Opens a private configuration
*
* CLI Command:
* - >configure private
*
* @return {String} returns open configuration RPC
*/
exports.openPrivateConfig = function() {
var rpc = '<rpc><open-configuration><private/></open-configuration></rpc>]]>]]>';
return rpc
};
/**
* Commit configuration
*
* Commits candidate configration
*
* CLI Command:
* - #commit
*
* @return {String} returns commit RPC
*/
exports.openPrivateConfig = function() {
var rpc = '<rpc><commit-configuration><log>NC Node Commit</log></commit-configuration></rpc></xsl:variable>]]>]]>';
return rpc
};