pyCSM 1.0.4__tar.gz → 1.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyCSM-1.0.4/pyCSM.egg-info → pyCSM-1.0.6}/PKG-INFO +1 -1
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/clients/session_client.py +42 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/session_service/schedule_service.py +69 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6/pyCSM.egg-info}/PKG-INFO +1 -1
- {pyCSM-1.0.4 → pyCSM-1.0.6}/setup.py +1 -1
- {pyCSM-1.0.4 → pyCSM-1.0.6}/LICENSE +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/README.md +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/docs/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/docs/conf.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/authorization/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/authorization/auth.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/clients/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/clients/hardware_client.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/clients/system_client.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/hardware_service/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/hardware_service/hardware_service.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/session_service/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/session_service/copyset_service.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/session_service/session_service.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/system_service/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/services/system_service/system_service.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/util/__init__.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM/util/utility.py +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM.egg-info/SOURCES.txt +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM.egg-info/dependency_links.txt +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM.egg-info/requires.txt +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/pyCSM.egg-info/top_level.txt +0 -0
- {pyCSM-1.0.4 → pyCSM-1.0.6}/setup.cfg +0 -0
|
@@ -318,6 +318,48 @@ class sessionClient:
|
|
|
318
318
|
return schedule_service.get_scheduled_tasks(self.base_url, self.tk)
|
|
319
319
|
return resp
|
|
320
320
|
|
|
321
|
+
def get_scheduled_task(self, taskid):
|
|
322
|
+
"""
|
|
323
|
+
Returns the scheduled task info of a given task id
|
|
324
|
+
|
|
325
|
+
Returns:
|
|
326
|
+
JSON String representing the result of the command.
|
|
327
|
+
'I' = successful, 'W' = warning, 'E' = error.
|
|
328
|
+
"""
|
|
329
|
+
resp = schedule_service.get_scheduled_task(self.base_url, self.tk, taskid)
|
|
330
|
+
if resp.status_code == 401:
|
|
331
|
+
self.tk = auth.get_token(self.base_url, self.username, self.password)
|
|
332
|
+
return schedule_service.get_scheduled_task(self.base_url, self.tk, taskid)
|
|
333
|
+
return resp
|
|
334
|
+
|
|
335
|
+
def create_scheduled_task(self, json):
|
|
336
|
+
"""
|
|
337
|
+
Creates a new task with given task info
|
|
338
|
+
|
|
339
|
+
Returns:
|
|
340
|
+
JSON String representing the result of the command.
|
|
341
|
+
'I' = successful, 'W' = warning, 'E' = error.
|
|
342
|
+
"""
|
|
343
|
+
resp = schedule_service.create_scheduled_task(self.base_url, self.tk, json)
|
|
344
|
+
if resp.status_code == 401:
|
|
345
|
+
self.tk = auth.get_token(self.base_url, self.username, self.password)
|
|
346
|
+
return schedule_service.create_scheduled_task(self.base_url, self.tk, json)
|
|
347
|
+
return resp
|
|
348
|
+
|
|
349
|
+
def duplicate_scheduled_task(self, taskid):
|
|
350
|
+
"""
|
|
351
|
+
Duplicates scheduled task of a given id
|
|
352
|
+
|
|
353
|
+
Returns:
|
|
354
|
+
JSON String representing the result of the command.
|
|
355
|
+
'I' = successful, 'W' = warning, 'E' = error.
|
|
356
|
+
"""
|
|
357
|
+
resp = schedule_service.duplicate_scheduled_task(self.base_url, self.tk, taskid)
|
|
358
|
+
if resp.status_code == 401:
|
|
359
|
+
self.tk = auth.get_token(self.base_url, self.username, self.password)
|
|
360
|
+
return schedule_service.duplicate_scheduled_task(self.base_url, self.tk, taskid)
|
|
361
|
+
return resp
|
|
362
|
+
|
|
321
363
|
@staticmethod
|
|
322
364
|
def get_properties():
|
|
323
365
|
"""
|
|
@@ -57,6 +57,75 @@ def get_scheduled_tasks(url, tk):
|
|
|
57
57
|
return requests.get(getst_url, headers=headers, verify=properties["verify"], cert=properties["cert"])
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
def get_scheduled_task(url, tk, taskid):
|
|
61
|
+
"""
|
|
62
|
+
Returns the scheduled task info of a given task id
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
url (str): Base url of csm server. ex. https://servername:port/CSM/web.
|
|
66
|
+
tk (str): Rest token for the CSM server.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
JSON String representing the result of the command.
|
|
70
|
+
'I' = successful, 'W' = warning, 'E' = error.
|
|
71
|
+
"""
|
|
72
|
+
getst_url = f"{url}/sessions/scheduledtasks/{taskid}"
|
|
73
|
+
headers = {
|
|
74
|
+
"Accept-Language": properties["language"],
|
|
75
|
+
"X-Auth-Token": str(tk),
|
|
76
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
77
|
+
}
|
|
78
|
+
return requests.get(getst_url, headers=headers, verify=properties["verify"], cert=properties["cert"])
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def create_scheduled_task(url, tk, json):
|
|
82
|
+
"""
|
|
83
|
+
Creates a new task with given task info
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
url (str): Base url of csm server. ex. https://servername:port/CSM/web.
|
|
87
|
+
tk (str): Rest token for the CSM server.
|
|
88
|
+
json (str): json string of scheduled task info used to create new scheduled task
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
JSON String representing the result of the command.
|
|
92
|
+
'I' = successful, 'W' = warning, 'E' = error.
|
|
93
|
+
"""
|
|
94
|
+
put_url = f"{url}/sessions/scheduledtasks"
|
|
95
|
+
headers = {
|
|
96
|
+
"Accept-Language": properties["language"],
|
|
97
|
+
"X-Auth-Token": str(tk),
|
|
98
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
99
|
+
}
|
|
100
|
+
params = {
|
|
101
|
+
"json": json
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return requests.put(put_url, headers=headers, verify=properties["verify"], cert=properties["cert"], data=params)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def duplicate_scheduled_task(url, tk, taskid):
|
|
108
|
+
"""
|
|
109
|
+
Duplicates scheduled task of a given id
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
url (str): Base url of csm server. ex. https://servername:port/CSM/web.
|
|
113
|
+
tk (str): Rest token for the CSM server.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
JSON String representing the result of the command.
|
|
117
|
+
'I' = successful, 'W' = warning, 'E' = error.
|
|
118
|
+
"""
|
|
119
|
+
put_url = f"{url}/sessions/scheduledtasks/duplicate/{taskid}"
|
|
120
|
+
headers = {
|
|
121
|
+
"Accept-Language": properties["language"],
|
|
122
|
+
"X-Auth-Token": str(tk),
|
|
123
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return requests.put(put_url, headers=headers, verify=properties["verify"], cert=properties["cert"])
|
|
127
|
+
|
|
128
|
+
|
|
60
129
|
def enable_scheduled_task(url, tk, taskid):
|
|
61
130
|
"""
|
|
62
131
|
Enable a scheduled task to run based off the schedule defined on the task.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|