Skip to content

Commit eb43577

Browse files
update command_runner module
1 parent bc67dee commit eb43577

File tree

1 file changed

+217
-0
lines changed

1 file changed

+217
-0
lines changed

dnacentersdk/api/v3_1_3_0/command_runner.py

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,154 @@ def get_all_keywords_of_clis_accepted_by_command_runner_v1(self,
116116

117117
return self._object_factory('bpm_e946adf864590082fe3111a2a2fa74_v3_1_3_0', json_data)
118118

119+
def get_all_keywords_of_clis_accepted_v1(self,
120+
headers=None,
121+
**request_parameters):
122+
"""Get valid keywords . This API has been deprecated and will not be available in
123+
a Cisco DNA Center release after April 1st 2026 23:59:59 GMT.
124+
This function will be replaced by the function get_all_keywords_of_clis_accepted_by_command_runner_v1.
125+
126+
Args:
127+
headers(dict): Dictionary of HTTP Headers to send with the Request
128+
.
129+
**request_parameters: Additional request parameters (provides
130+
support for parameters that may be added in the future).
131+
132+
Returns:
133+
MyDict: JSON response. Access the object's properties by using
134+
the dot notation or the bracket notation.
135+
136+
Raises:
137+
TypeError: If the parameter types are incorrect.
138+
MalformedRequest: If the request body created is invalid.
139+
ApiError: If the DNA Center cloud returns an error.
140+
Documentation Link:
141+
https://developer.cisco.com/docs/dna-center/#!get-all-keywords-of-c-l-is-accepted-by-command-runner
142+
"""
143+
check_type(headers, dict)
144+
if headers is not None:
145+
if 'X-Auth-Token' in headers:
146+
check_type(headers.get('X-Auth-Token'),
147+
str, may_be_none=False)
148+
149+
_params = {
150+
}
151+
_params.update(request_parameters)
152+
_params = dict_from_items_with_values(_params)
153+
154+
path_params = {
155+
}
156+
157+
with_custom_headers = False
158+
_headers = self._session.headers or {}
159+
if headers:
160+
_headers.update(dict_of_str(headers))
161+
with_custom_headers = True
162+
163+
e_url = ('/dna/intent/api/v1/network-device-poller/cli/legit-reads')
164+
endpoint_full_url = apply_path_params(e_url, path_params)
165+
if with_custom_headers:
166+
json_data = self._session.get(endpoint_full_url, params=_params,
167+
headers=_headers)
168+
else:
169+
json_data = self._session.get(endpoint_full_url, params=_params)
170+
171+
return self._object_factory('bpm_e946adf864590082fe3111a2a2fa74_v2_3_7_6', json_data)
172+
173+
def run_read_only_commands_on_devices_v1(self,
174+
commands=None,
175+
description=None,
176+
deviceUuids=None,
177+
name=None,
178+
timeout=None,
179+
headers=None,
180+
payload=None,
181+
active_validation=True,
182+
**request_parameters):
183+
"""Submit request for read-only CLIs . This API has been deprecated and will not be available in a Cisco DNA
184+
Center release after April 1st 2026 23:59:59 GMT.This function will be replaced by the function
185+
run_read_only_commands_on_devices_to_get_their_real_time_configuration_v1.
186+
187+
Args:
188+
commands(list): Command Runner's Commands to be executed (list of strings).
189+
description(string): Command Runner's Describe the details about the command request .
190+
deviceUuids(list): Command Runner's Device Id of the device (list of strings).
191+
name(string): Command Runner's Name of the the request like getshowrun , deviceinterfacestatusCli. .
192+
timeout(integer): Command Runner's The timeout value in unit of second. If no timeout provided wait till
193+
300sec .
194+
headers(dict): Dictionary of HTTP Headers to send with the Request
195+
.
196+
payload(dict): A JSON serializable Python object to send in the
197+
body of the Request.
198+
active_validation(bool): Enable/Disable payload validation.
199+
Defaults to True.
200+
**request_parameters: Additional request parameters (provides
201+
support for parameters that may be added in the future).
202+
203+
Returns:
204+
MyDict: JSON response. Access the object's properties by using
205+
the dot notation or the bracket notation.
206+
207+
Raises:
208+
TypeError: If the parameter types are incorrect.
209+
MalformedRequest: If the request body created is invalid.
210+
ApiError: If the DNA Center cloud returns an error.
211+
Documentation Link:
212+
https://developer.cisco.com/docs/dna-center/#!run-read-only-commands-on-devices-to-get-their-real-time-configuration
213+
"""
214+
check_type(headers, dict)
215+
check_type(payload, dict)
216+
if headers is not None:
217+
if 'Content-Type' in headers:
218+
check_type(headers.get('Content-Type'),
219+
str, may_be_none=False)
220+
if 'X-Auth-Token' in headers:
221+
check_type(headers.get('X-Auth-Token'),
222+
str, may_be_none=False)
223+
224+
_params = {
225+
}
226+
_params.update(request_parameters)
227+
_params = dict_from_items_with_values(_params)
228+
229+
path_params = {
230+
}
231+
_payload = {
232+
'commands':
233+
commands,
234+
'description':
235+
description,
236+
'deviceUuids':
237+
deviceUuids,
238+
'name':
239+
name,
240+
'timeout':
241+
timeout,
242+
}
243+
_payload.update(payload or {})
244+
_payload = dict_from_items_with_values(_payload)
245+
if active_validation:
246+
self._request_validator('jsd_b2dae3b41636596aa02c3ad0a4bcb8d7_v2_3_7_6')\
247+
.validate(_payload)
248+
249+
with_custom_headers = False
250+
_headers = self._session.headers or {}
251+
if headers:
252+
_headers.update(dict_of_str(headers))
253+
with_custom_headers = True
254+
255+
e_url = ('/dna/intent/api/v1/network-device-poller/cli/read-'
256+
+ 'request')
257+
endpoint_full_url = apply_path_params(e_url, path_params)
258+
if with_custom_headers:
259+
json_data = self._session.post(endpoint_full_url, params=_params,
260+
json=_payload,
261+
headers=_headers)
262+
else:
263+
json_data = self._session.post(endpoint_full_url, params=_params,
264+
json=_payload)
265+
266+
return self._object_factory('bpm_b2dae3b41636596aa02c3ad0a4bcb8d7_v2_3_7_6', json_data)
119267

120268
def run_read_only_commands_on_devices_to_get_their_real_time_configuration_v1(self,
121269
commands=None,
@@ -231,6 +379,28 @@ def get_all_keywords_of_clis_accepted_by_command_runner(self,
231379
**request_parameters
232380
)
233381

382+
# Alias Function
383+
def get_all_keywords_of_clis_accepted(self,
384+
headers=None,
385+
**request_parameters):
386+
"""This function is an alias of get_all_keywords_of_clis_accepted_v1.
387+
This API has been deprecated and will not be available in a Cisco DNA Center
388+
release after April 1st 2026 23:59:59 GMT. This function will be replaced by the function
389+
get_all_keywords_of_clis_accepted_by_command_runner.
390+
391+
Args:
392+
headers(dict): Dictionary of HTTP Headers to send with the Request
393+
.
394+
**request_parameters: Additional request parameters (provides
395+
support for parameters that may be added in the future).
396+
397+
Returns:
398+
This function returns the output of get_all_keywords_of_clis_accepted_v1.
399+
"""
400+
return self.get_all_keywords_of_clis_accepted_v1(
401+
headers=headers,
402+
**request_parameters
403+
)
234404

235405
# Alias Function
236406
def run_read_only_commands_on_devices_to_get_their_real_time_configuration(self,
@@ -274,3 +444,50 @@ def run_read_only_commands_on_devices_to_get_their_real_time_configuration(self,
274444
active_validation=active_validation,
275445
**request_parameters
276446
)
447+
448+
# Alias Function
449+
def run_read_only_commands_on_devices(self,
450+
commands=None,
451+
description=None,
452+
deviceUuids=None,
453+
name=None,
454+
timeout=None,
455+
headers=None,
456+
payload=None,
457+
active_validation=True,
458+
**request_parameters):
459+
"""This function is an alias of run_read_only_commands_on_devices_v1.
460+
This API has been deprecated and will not be available in a Cisco DNA Center
461+
release after April 1st 2026 23:59:59 GMT.
462+
This function will be replaced by the function run_read_only_commands_on_devices_to_get_their_real_time_configuration_v1.
463+
Args:
464+
commands(list): Command Runner's Commands to be executed (list of strings).
465+
description(string): Command Runner's Describe the details about the command request .
466+
deviceUuids(list): Command Runner's Device Id of the device (list of strings).
467+
name(string): Command Runner's Name of the the request like getshowrun , deviceinterfacestatusCli. .
468+
timeout(integer): Command Runner's The timeout value in unit of second. If no timeout provided wait till
469+
300sec .
470+
headers(dict): Dictionary of HTTP Headers to send with the Request
471+
.
472+
payload(dict): A JSON serializable Python object to send in the
473+
body of the Request.
474+
active_validation(bool): Enable/Disable payload validation.
475+
Defaults to True.
476+
**request_parameters: Additional request parameters (provides
477+
support for parameters that may be added in the future).
478+
479+
Returns:
480+
This function returns the output of run_read_only_commands_on_devices_v1.
481+
"""
482+
return self.run_read_only_commands_on_devices_v1(
483+
commands=commands,
484+
description=description,
485+
deviceUuids=deviceUuids,
486+
name=name,
487+
timeout=timeout,
488+
headers=headers,
489+
payload=payload,
490+
active_validation=active_validation,
491+
**request_parameters
492+
)
493+

0 commit comments

Comments
 (0)