1 |
4911f0ea
|
Matej Zeman
|
<!doctype html>
|
2 |
|
|
<html lang="en">
|
3 |
|
|
<head>
|
4 |
|
|
<meta charset="utf-8">
|
5 |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
6 |
|
|
<meta name="generator" content="pdoc 0.10.0" />
|
7 |
|
|
<title>sql_app.crud API documentation</title>
|
8 |
|
|
<meta name="description" content="" />
|
9 |
|
|
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
10 |
|
|
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
11 |
|
|
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
12 |
|
|
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
13 |
|
|
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
14 |
|
|
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
15 |
|
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
16 |
|
|
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
17 |
|
|
</head>
|
18 |
|
|
<body>
|
19 |
|
|
<main>
|
20 |
|
|
<article id="content">
|
21 |
|
|
<header>
|
22 |
|
|
<h1 class="title">Module <code>sql_app.crud</code></h1>
|
23 |
|
|
</header>
|
24 |
|
|
<section id="section-intro">
|
25 |
|
|
<details class="source">
|
26 |
|
|
<summary>
|
27 |
|
|
<span>Expand source code</span>
|
28 |
|
|
</summary>
|
29 |
|
|
<pre><code class="python">from datetime import datetime, date
|
30 |
|
|
|
31 |
|
|
from sqlalchemy.orm import Session
|
32 |
|
|
from sqlalchemy import and_, desc
|
33 |
|
|
from . import models, schemas
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
def get_device(db: Session, device_id: int):
|
37 |
|
|
"""
|
38 |
|
|
returns one specific devices by given id
|
39 |
|
|
"""
|
40 |
|
|
return db.query(models.Device).filter(models.Device.id == device_id).first()
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
def get_devices(db: Session, skip: int = 0, limit: int = 100):
|
44 |
|
|
"""
|
45 |
|
|
returns all devices in database
|
46 |
|
|
"""
|
47 |
|
|
return db.query(models.Device).offset(skip).limit(limit).all()
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
def find_device(db: Session, device: schemas.DeviceBase):
|
51 |
|
|
"""
|
52 |
|
|
finds one device with product_id, vendor_id and serial_number same as in given DeviceBase object
|
53 |
|
|
"""
|
54 |
|
|
return db.query(models.Device).filter(and_(models.Device.product_id == device.product_id,
|
55 |
|
|
models.Device.vendor_id == device.vendor_id,
|
56 |
|
|
models.Device.serial_number == device.serial_number)).first()
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
def create_device(db: Session, device: schemas.DeviceBase):
|
60 |
|
|
"""
|
61 |
|
|
creates new device with data from given DeviceBase object
|
62 |
|
|
"""
|
63 |
|
|
db_device = models.Device(vendor_id=device.vendor_id, product_id=device.product_id,
|
64 |
|
|
serial_number=device.serial_number, assigned=False)
|
65 |
|
|
db.add(db_device)
|
66 |
|
|
db.commit()
|
67 |
|
|
db.refresh(db_device)
|
68 |
|
|
return db_device
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
def get_license(db: Session, license_id: int):
|
72 |
|
|
"""
|
73 |
|
|
returns one specific license by given id
|
74 |
|
|
"""
|
75 |
|
|
return db.query(models.License).filter(models.License.id == license_id).first()
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
def get_licenses(db: Session, skip: int = 0, limit: int = 100):
|
79 |
|
|
"""
|
80 |
|
|
returns all licenses in database
|
81 |
|
|
"""
|
82 |
|
|
return db.query(models.License).offset(skip).limit(limit).all()
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
def find_license(db: Session, name: str):
|
86 |
|
|
"""
|
87 |
|
|
finds one license by given string name
|
88 |
|
|
"""
|
89 |
|
|
return db.query(models.License).filter(models.License.name == name).first()
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
def create_license(db: Session, name: str, expdate: date):
|
93 |
|
|
"""
|
94 |
|
|
creates new license with given name and expiration date
|
95 |
|
|
"""
|
96 |
|
|
db_license = models.License(name=name, expiration_date=expdate)
|
97 |
|
|
db.add(db_license)
|
98 |
|
|
db.commit()
|
99 |
|
|
db.refresh(db_license)
|
100 |
|
|
return db_license
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
def get_license_devices(db: Session, license_id: int):
|
104 |
|
|
"""
|
105 |
|
|
returns all entries in devices_licenses table
|
106 |
|
|
"""
|
107 |
|
|
return db.query(models.DeviceLicense).filter(models.DeviceLicense.license_id == license_id).all()
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
def create_device_license(db: Session, device: int, license: int, time: datetime):
|
111 |
|
|
"""
|
112 |
|
|
creates new entry in devices_licenses table with device id, license id and time.
|
113 |
|
|
"""
|
114 |
|
|
db_device_license = models.DeviceLicense(device_id=device, license_id=license,
|
115 |
|
|
assigned_datetime=time)
|
116 |
|
|
db.add(db_device_license)
|
117 |
|
|
db.commit()
|
118 |
|
|
db.refresh(db_device_license)
|
119 |
|
|
return db_device_license
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
def find_pc_by_username(db: Session, name: str):
|
123 |
|
|
"""
|
124 |
|
|
Finds one pc by given username
|
125 |
|
|
"""
|
126 |
|
|
return db.query(models.PC).filter(models.PC.username == name).first()
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
def get_pc(db: Session, pc_id: int):
|
130 |
|
|
"""
|
131 |
|
|
returns one specific pc by given id
|
132 |
|
|
"""
|
133 |
|
|
return db.query(models.PC).filter(models.PC.id == pc_id).first()
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
def update_pc(db: Session, pc_id: int, team: str):
|
137 |
|
|
"""
|
138 |
|
|
Function updates team of one specific pc
|
139 |
|
|
"""
|
140 |
|
|
old_pc = get_pc(db, pc_id)
|
141 |
|
|
team = get_team(db, int(team))
|
142 |
|
|
new = {'id': old_pc.id, 'username': old_pc.username, 'hostname': old_pc.hostname, 'assigned': True,
|
143 |
|
|
'team_id': team.id}
|
144 |
|
|
for key, value in new.items():
|
145 |
|
|
setattr(old_pc, key, value)
|
146 |
|
|
db.commit()
|
147 |
|
|
db.refresh(old_pc)
|
148 |
|
|
return old_pc
|
149 |
|
|
|
150 |
|
|
|
151 |
|
|
def get_pcs(db: Session, skip: int = 0, limit: int = 100):
|
152 |
|
|
"""
|
153 |
|
|
returns all pcs in database
|
154 |
|
|
"""
|
155 |
|
|
return db.query(models.PC).offset(skip).limit(limit).all()
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
def find_pc(db: Session, username: str, hostname: str):
|
159 |
|
|
"""
|
160 |
|
|
Finds one pc with given username and hostname
|
161 |
|
|
"""
|
162 |
|
|
return db.query(models.PC).filter(and_(models.PC.username == username,
|
163 |
|
|
models.PC.hostname == hostname)).first()
|
164 |
|
|
|
165 |
|
|
|
166 |
|
|
def find_pc_by_name(db: Session, username: str):
|
167 |
|
|
"""
|
168 |
|
|
Finds one pc by its username
|
169 |
|
|
"""
|
170 |
|
|
return db.query(models.PC).filter(models.PC.username == username).first()
|
171 |
|
|
|
172 |
|
|
|
173 |
|
|
def find_pc_by_name_all(db: Session, username: str):
|
174 |
|
|
"""
|
175 |
|
|
Finds all pcs with same username
|
176 |
|
|
"""
|
177 |
|
|
return db.query(models.PC).filter(models.PC.username == username).offset(0).limit(100).all()
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
def find_pcs(db: Session, pcs: []):
|
181 |
|
|
"""
|
182 |
|
|
Finds all pcs with ids in given id array
|
183 |
|
|
"""
|
184 |
|
|
return db.query(models.PC).filter(models.PC.id.in_(pcs)).all()
|
185 |
|
|
|
186 |
|
|
|
187 |
|
|
def get_pcs_by_team(db: Session, team_id: int):
|
188 |
|
|
"""
|
189 |
|
|
returns all pcs in given team by team id
|
190 |
|
|
"""
|
191 |
|
|
return db.query(models.PC).filter(models.PC.team_id == team_id).all()
|
192 |
|
|
|
193 |
|
|
|
194 |
|
|
def create_pc(db: Session, user: str, host: str):
|
195 |
|
|
"""
|
196 |
|
|
creates new pc with given username and hostname
|
197 |
|
|
"""
|
198 |
|
|
db_pc = models.PC(username=user, hostname=host, assigned=False)
|
199 |
|
|
db.add(db_pc)
|
200 |
|
|
db.commit()
|
201 |
|
|
db.refresh(db_pc)
|
202 |
|
|
return db_pc
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
def get_team(db: Session, team_id: int):
|
206 |
|
|
"""
|
207 |
|
|
returns one specific team wit given id
|
208 |
|
|
"""
|
209 |
|
|
return db.query(models.Team).filter(models.Team.id == team_id).first()
|
210 |
|
|
|
211 |
|
|
|
212 |
|
|
def get_teams(db: Session, skip: int = 0, limit: int = 100):
|
213 |
|
|
"""
|
214 |
|
|
returns all teams currently saved in database
|
215 |
|
|
"""
|
216 |
|
|
return db.query(models.Team).offset(skip).limit(limit).all()
|
217 |
|
|
|
218 |
|
|
|
219 |
|
|
def find_team(db: Session, name: str):
|
220 |
|
|
"""
|
221 |
|
|
Finds one specific team by its name
|
222 |
|
|
"""
|
223 |
|
|
return db.query(models.Team).filter(models.Team.name == name).first()
|
224 |
|
|
|
225 |
|
|
|
226 |
|
|
def create_team(db: Session, name: str):
|
227 |
|
|
"""
|
228 |
|
|
Creates new team with given name
|
229 |
|
|
"""
|
230 |
|
|
db_team = models.Team(name=name)
|
231 |
|
|
db.add(db_team)
|
232 |
|
|
db.commit()
|
233 |
|
|
db.refresh(db_team)
|
234 |
|
|
return db_team
|
235 |
|
|
|
236 |
|
|
|
237 |
|
|
def get_head_device(db: Session, head_id: int):
|
238 |
|
|
"""
|
239 |
|
|
Returns one specific head device by given id
|
240 |
|
|
"""
|
241 |
|
|
return db.query(models.HeadDevice).filter(models.HeadDevice.id == head_id).first()
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
def get_head_devices(db: Session, skip: int = 0, limit: int = 100):
|
245 |
|
|
"""
|
246 |
|
|
Returns all head devices saved in database
|
247 |
|
|
"""
|
248 |
|
|
return db.query(models.HeadDevice).offset(skip).limit(limit).all()
|
249 |
|
|
|
250 |
|
|
|
251 |
|
|
def find_head_device(db: Session, serial: schemas.HeadDeviceBase):
|
252 |
|
|
"""
|
253 |
|
|
Finds one head device by its serial number
|
254 |
|
|
"""
|
255 |
|
|
return db.query(models.HeadDevice).filter(models.HeadDevice.serial_number == serial.serial_number).first()
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
def create_head_device(db: Session, log: schemas.HeadDeviceBase):
|
259 |
|
|
"""
|
260 |
|
|
Creates new head device
|
261 |
|
|
"""
|
262 |
|
|
db_head = models.HeadDevice(serial_number=log.serial_number)
|
263 |
|
|
db.add(db_head)
|
264 |
|
|
db.commit()
|
265 |
|
|
db.refresh(db_head)
|
266 |
|
|
return db_head
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
def get_body_device(db: Session, body_id: int):
|
270 |
|
|
"""
|
271 |
|
|
Returns one specific body device by given id
|
272 |
|
|
"""
|
273 |
|
|
return db.query(models.BodyDevice).filter(models.BodyDevice.id == body_id).first()
|
274 |
|
|
|
275 |
|
|
|
276 |
|
|
def get_body_devices(db: Session, skip: int = 0, limit: int = 100):
|
277 |
|
|
"""
|
278 |
|
|
Returns all body devices saved in database
|
279 |
|
|
"""
|
280 |
|
|
return db.query(models.BodyDevice).offset(skip).limit(limit).all()
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
def find_body_device(db: Session, serial: schemas.BodyDeviceBase):
|
284 |
|
|
"""
|
285 |
|
|
Finds one body device by its serial number
|
286 |
|
|
"""
|
287 |
|
|
return db.query(models.BodyDevice).filter(models.BodyDevice.serial_number == serial.serial_number).first()
|
288 |
|
|
|
289 |
|
|
|
290 |
|
|
def create_body_device(db: Session, log: schemas.BodyDeviceBase):
|
291 |
|
|
"""
|
292 |
|
|
Creates new Body device
|
293 |
|
|
"""
|
294 |
|
|
db_body = models.BodyDevice(serial_number=log.serial_number)
|
295 |
|
|
db.add(db_body)
|
296 |
|
|
db.commit()
|
297 |
|
|
db.refresh(db_body)
|
298 |
|
|
return db_body
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
def get_ld_logs(db: Session, skip: int = 0, limit: int = 100):
|
302 |
|
|
"""
|
303 |
|
|
Returns all ld debugger logs in database
|
304 |
|
|
"""
|
305 |
|
|
return db.query(models.LDLog).offset(skip).limit(limit).all()
|
306 |
|
|
|
307 |
|
|
|
308 |
|
|
def create_ld_logs(db: Session, item: schemas.LDTempBase, head_id: int, body_id: int, pc_id: int, date: datetime):
|
309 |
|
|
"""
|
310 |
|
|
Creates new ld log for ld_logs database table
|
311 |
|
|
"""
|
312 |
|
|
db_ld = models.LDLog(pc_id=pc_id, timestamp=date, status=item.status, head_id=head_id, body_id=body_id)
|
313 |
|
|
db.add(db_ld)
|
314 |
|
|
db.commit()
|
315 |
|
|
db.refresh(db_ld)
|
316 |
|
|
return db_ld
|
317 |
|
|
|
318 |
|
|
|
319 |
|
|
def get_logs(db: Session, skip: int = 0, limit: int = 100):
|
320 |
|
|
"""
|
321 |
|
|
Returns all usb logs in database ordered by timestamp
|
322 |
|
|
"""
|
323 |
|
|
return db.query(models.USBLog).order_by(desc(models.USBLog.timestamp)).offset(skip).limit(limit).all()
|
324 |
|
|
|
325 |
|
|
|
326 |
|
|
def get_log(db: Session, device_id: int, skip: int = 0, limit: int = 100):
|
327 |
|
|
"""
|
328 |
|
|
Returns all usb logs in database sorted by id
|
329 |
|
|
"""
|
330 |
|
|
return db.query(models.USBLog).filter(models.USBLog.device_id == device_id).offset(skip).limit(limit).all()
|
331 |
|
|
|
332 |
|
|
|
333 |
|
|
def find_filtered_logs(db: Session, logs: []):
|
334 |
|
|
"""
|
335 |
|
|
Returns all usb logs with ids in given id array.
|
336 |
|
|
"""
|
337 |
|
|
return db.query(models.USBLog).filter(models.USBLog.id.in_(logs)).order_by(desc(models.USBLog.timestamp)).all()
|
338 |
|
|
|
339 |
|
|
|
340 |
|
|
def get_filtered_logs(db: Session, pc: str, tema: str, lic: str):
|
341 |
|
|
"""
|
342 |
|
|
Function creates query string used for filtering by pc username, team name and license name.
|
343 |
|
|
Depending on selected filters assembles query string for database
|
344 |
|
|
"""
|
345 |
|
|
execute_string = "SELECT * FROM usb_logs AS logs"
|
346 |
|
|
if pc != "all":
|
347 |
|
|
pcs = find_pc_by_username(db, pc)
|
348 |
|
|
execute_string += " WHERE logs.pc_id = " + str(pcs.id)
|
349 |
|
|
if tema != "all":
|
350 |
|
|
team = find_team(db, tema)
|
351 |
|
|
pcs = get_pcs_by_team(db, team.id)
|
352 |
|
|
pc_ids = "("
|
353 |
|
|
for p in pcs:
|
354 |
|
|
pc_ids += str(p.id) + ", "
|
355 |
|
|
def_pc_ids = pc_ids[:-2] + ")"
|
356 |
|
|
if pc != "all":
|
357 |
|
|
execute_string += " AND logs.pc_id IN " + def_pc_ids
|
358 |
|
|
else:
|
359 |
|
|
execute_string += " WHERE logs.pc_id IN " + def_pc_ids
|
360 |
|
|
if lic != "all":
|
361 |
|
|
license = find_license(db, lic)
|
362 |
|
|
device_licenses = get_license_devices(db, license.id)
|
363 |
|
|
dev_ids = "("
|
364 |
|
|
for dev in device_licenses:
|
365 |
|
|
dev_ids += str(dev.device_id) + ", "
|
366 |
|
|
defin_ids = dev_ids[:-2] + ")"
|
367 |
|
|
if pc != "all" or tema != "all":
|
368 |
|
|
execute_string += " AND logs.device_id IN " + defin_ids
|
369 |
|
|
else:
|
370 |
|
|
execute_string += " WHERE logs.device_id IN " + defin_ids
|
371 |
|
|
|
372 |
|
|
# executing assembled query string
|
373 |
|
|
result = db.execute(execute_string)
|
374 |
|
|
return result
|
375 |
|
|
|
376 |
|
|
|
377 |
|
|
def create_device_logs(db: Session, item: schemas.USBTempBase, dev_id: int, pc_id: int, date: datetime):
|
378 |
|
|
"""
|
379 |
|
|
Creates new USB log for usb_logs database table
|
380 |
|
|
"""
|
381 |
|
|
db_log = models.USBLog(pc_id=pc_id, timestamp=date, status=item.status, device_id=dev_id)
|
382 |
|
|
db.add(db_log)
|
383 |
|
|
db.commit()
|
384 |
|
|
db.refresh(db_log)
|
385 |
|
|
return db_log</code></pre>
|
386 |
|
|
</details>
|
387 |
|
|
</section>
|
388 |
|
|
<section>
|
389 |
|
|
</section>
|
390 |
|
|
<section>
|
391 |
|
|
</section>
|
392 |
|
|
<section>
|
393 |
|
|
<h2 class="section-title" id="header-functions">Functions</h2>
|
394 |
|
|
<dl>
|
395 |
|
|
<dt id="sql_app.crud.create_body_device"><code class="name flex">
|
396 |
|
|
<span>def <span class="ident">create_body_device</span></span>(<span>db: sqlalchemy.orm.session.Session, log: <a title="sql_app.schemas.BodyDeviceBase" href="schemas.html#sql_app.schemas.BodyDeviceBase">BodyDeviceBase</a>)</span>
|
397 |
|
|
</code></dt>
|
398 |
|
|
<dd>
|
399 |
|
|
<div class="desc"><p>Creates new Body device</p></div>
|
400 |
|
|
<details class="source">
|
401 |
|
|
<summary>
|
402 |
|
|
<span>Expand source code</span>
|
403 |
|
|
</summary>
|
404 |
|
|
<pre><code class="python">def create_body_device(db: Session, log: schemas.BodyDeviceBase):
|
405 |
|
|
"""
|
406 |
|
|
Creates new Body device
|
407 |
|
|
"""
|
408 |
|
|
db_body = models.BodyDevice(serial_number=log.serial_number)
|
409 |
|
|
db.add(db_body)
|
410 |
|
|
db.commit()
|
411 |
|
|
db.refresh(db_body)
|
412 |
|
|
return db_body</code></pre>
|
413 |
|
|
</details>
|
414 |
|
|
</dd>
|
415 |
|
|
<dt id="sql_app.crud.create_device"><code class="name flex">
|
416 |
|
|
<span>def <span class="ident">create_device</span></span>(<span>db: sqlalchemy.orm.session.Session, device: <a title="sql_app.schemas.DeviceBase" href="schemas.html#sql_app.schemas.DeviceBase">DeviceBase</a>)</span>
|
417 |
|
|
</code></dt>
|
418 |
|
|
<dd>
|
419 |
|
|
<div class="desc"><p>creates new device with data from given DeviceBase object</p></div>
|
420 |
|
|
<details class="source">
|
421 |
|
|
<summary>
|
422 |
|
|
<span>Expand source code</span>
|
423 |
|
|
</summary>
|
424 |
|
|
<pre><code class="python">def create_device(db: Session, device: schemas.DeviceBase):
|
425 |
|
|
"""
|
426 |
|
|
creates new device with data from given DeviceBase object
|
427 |
|
|
"""
|
428 |
|
|
db_device = models.Device(vendor_id=device.vendor_id, product_id=device.product_id,
|
429 |
|
|
serial_number=device.serial_number, assigned=False)
|
430 |
|
|
db.add(db_device)
|
431 |
|
|
db.commit()
|
432 |
|
|
db.refresh(db_device)
|
433 |
|
|
return db_device</code></pre>
|
434 |
|
|
</details>
|
435 |
|
|
</dd>
|
436 |
|
|
<dt id="sql_app.crud.create_device_license"><code class="name flex">
|
437 |
|
|
<span>def <span class="ident">create_device_license</span></span>(<span>db: sqlalchemy.orm.session.Session, device: int, license: int, time: datetime.datetime)</span>
|
438 |
|
|
</code></dt>
|
439 |
|
|
<dd>
|
440 |
|
|
<div class="desc"><p>creates new entry in devices_licenses table with device id, license id and time.</p></div>
|
441 |
|
|
<details class="source">
|
442 |
|
|
<summary>
|
443 |
|
|
<span>Expand source code</span>
|
444 |
|
|
</summary>
|
445 |
|
|
<pre><code class="python">def create_device_license(db: Session, device: int, license: int, time: datetime):
|
446 |
|
|
"""
|
447 |
|
|
creates new entry in devices_licenses table with device id, license id and time.
|
448 |
|
|
"""
|
449 |
|
|
db_device_license = models.DeviceLicense(device_id=device, license_id=license,
|
450 |
|
|
assigned_datetime=time)
|
451 |
|
|
db.add(db_device_license)
|
452 |
|
|
db.commit()
|
453 |
|
|
db.refresh(db_device_license)
|
454 |
|
|
return db_device_license</code></pre>
|
455 |
|
|
</details>
|
456 |
|
|
</dd>
|
457 |
|
|
<dt id="sql_app.crud.create_device_logs"><code class="name flex">
|
458 |
|
|
<span>def <span class="ident">create_device_logs</span></span>(<span>db: sqlalchemy.orm.session.Session, item: <a title="sql_app.schemas.USBTempBase" href="schemas.html#sql_app.schemas.USBTempBase">USBTempBase</a>, dev_id: int, pc_id: int, date: datetime.datetime)</span>
|
459 |
|
|
</code></dt>
|
460 |
|
|
<dd>
|
461 |
|
|
<div class="desc"><p>Creates new USB log for usb_logs database table</p></div>
|
462 |
|
|
<details class="source">
|
463 |
|
|
<summary>
|
464 |
|
|
<span>Expand source code</span>
|
465 |
|
|
</summary>
|
466 |
|
|
<pre><code class="python">def create_device_logs(db: Session, item: schemas.USBTempBase, dev_id: int, pc_id: int, date: datetime):
|
467 |
|
|
"""
|
468 |
|
|
Creates new USB log for usb_logs database table
|
469 |
|
|
"""
|
470 |
|
|
db_log = models.USBLog(pc_id=pc_id, timestamp=date, status=item.status, device_id=dev_id)
|
471 |
|
|
db.add(db_log)
|
472 |
|
|
db.commit()
|
473 |
|
|
db.refresh(db_log)
|
474 |
|
|
return db_log</code></pre>
|
475 |
|
|
</details>
|
476 |
|
|
</dd>
|
477 |
|
|
<dt id="sql_app.crud.create_head_device"><code class="name flex">
|
478 |
|
|
<span>def <span class="ident">create_head_device</span></span>(<span>db: sqlalchemy.orm.session.Session, log: <a title="sql_app.schemas.HeadDeviceBase" href="schemas.html#sql_app.schemas.HeadDeviceBase">HeadDeviceBase</a>)</span>
|
479 |
|
|
</code></dt>
|
480 |
|
|
<dd>
|
481 |
|
|
<div class="desc"><p>Creates new head device</p></div>
|
482 |
|
|
<details class="source">
|
483 |
|
|
<summary>
|
484 |
|
|
<span>Expand source code</span>
|
485 |
|
|
</summary>
|
486 |
|
|
<pre><code class="python">def create_head_device(db: Session, log: schemas.HeadDeviceBase):
|
487 |
|
|
"""
|
488 |
|
|
Creates new head device
|
489 |
|
|
"""
|
490 |
|
|
db_head = models.HeadDevice(serial_number=log.serial_number)
|
491 |
|
|
db.add(db_head)
|
492 |
|
|
db.commit()
|
493 |
|
|
db.refresh(db_head)
|
494 |
|
|
return db_head</code></pre>
|
495 |
|
|
</details>
|
496 |
|
|
</dd>
|
497 |
|
|
<dt id="sql_app.crud.create_ld_logs"><code class="name flex">
|
498 |
|
|
<span>def <span class="ident">create_ld_logs</span></span>(<span>db: sqlalchemy.orm.session.Session, item: <a title="sql_app.schemas.LDTempBase" href="schemas.html#sql_app.schemas.LDTempBase">LDTempBase</a>, head_id: int, body_id: int, pc_id: int, date: datetime.datetime)</span>
|
499 |
|
|
</code></dt>
|
500 |
|
|
<dd>
|
501 |
|
|
<div class="desc"><p>Creates new ld log for ld_logs database table</p></div>
|
502 |
|
|
<details class="source">
|
503 |
|
|
<summary>
|
504 |
|
|
<span>Expand source code</span>
|
505 |
|
|
</summary>
|
506 |
|
|
<pre><code class="python">def create_ld_logs(db: Session, item: schemas.LDTempBase, head_id: int, body_id: int, pc_id: int, date: datetime):
|
507 |
|
|
"""
|
508 |
|
|
Creates new ld log for ld_logs database table
|
509 |
|
|
"""
|
510 |
|
|
db_ld = models.LDLog(pc_id=pc_id, timestamp=date, status=item.status, head_id=head_id, body_id=body_id)
|
511 |
|
|
db.add(db_ld)
|
512 |
|
|
db.commit()
|
513 |
|
|
db.refresh(db_ld)
|
514 |
|
|
return db_ld</code></pre>
|
515 |
|
|
</details>
|
516 |
|
|
</dd>
|
517 |
|
|
<dt id="sql_app.crud.create_license"><code class="name flex">
|
518 |
|
|
<span>def <span class="ident">create_license</span></span>(<span>db: sqlalchemy.orm.session.Session, name: str, expdate: datetime.date)</span>
|
519 |
|
|
</code></dt>
|
520 |
|
|
<dd>
|
521 |
|
|
<div class="desc"><p>creates new license with given name and expiration date</p></div>
|
522 |
|
|
<details class="source">
|
523 |
|
|
<summary>
|
524 |
|
|
<span>Expand source code</span>
|
525 |
|
|
</summary>
|
526 |
|
|
<pre><code class="python">def create_license(db: Session, name: str, expdate: date):
|
527 |
|
|
"""
|
528 |
|
|
creates new license with given name and expiration date
|
529 |
|
|
"""
|
530 |
|
|
db_license = models.License(name=name, expiration_date=expdate)
|
531 |
|
|
db.add(db_license)
|
532 |
|
|
db.commit()
|
533 |
|
|
db.refresh(db_license)
|
534 |
|
|
return db_license</code></pre>
|
535 |
|
|
</details>
|
536 |
|
|
</dd>
|
537 |
|
|
<dt id="sql_app.crud.create_pc"><code class="name flex">
|
538 |
|
|
<span>def <span class="ident">create_pc</span></span>(<span>db: sqlalchemy.orm.session.Session, user: str, host: str)</span>
|
539 |
|
|
</code></dt>
|
540 |
|
|
<dd>
|
541 |
|
|
<div class="desc"><p>creates new pc with given username and hostname</p></div>
|
542 |
|
|
<details class="source">
|
543 |
|
|
<summary>
|
544 |
|
|
<span>Expand source code</span>
|
545 |
|
|
</summary>
|
546 |
|
|
<pre><code class="python">def create_pc(db: Session, user: str, host: str):
|
547 |
|
|
"""
|
548 |
|
|
creates new pc with given username and hostname
|
549 |
|
|
"""
|
550 |
|
|
db_pc = models.PC(username=user, hostname=host, assigned=False)
|
551 |
|
|
db.add(db_pc)
|
552 |
|
|
db.commit()
|
553 |
|
|
db.refresh(db_pc)
|
554 |
|
|
return db_pc</code></pre>
|
555 |
|
|
</details>
|
556 |
|
|
</dd>
|
557 |
|
|
<dt id="sql_app.crud.create_team"><code class="name flex">
|
558 |
|
|
<span>def <span class="ident">create_team</span></span>(<span>db: sqlalchemy.orm.session.Session, name: str)</span>
|
559 |
|
|
</code></dt>
|
560 |
|
|
<dd>
|
561 |
|
|
<div class="desc"><p>Creates new team with given name</p></div>
|
562 |
|
|
<details class="source">
|
563 |
|
|
<summary>
|
564 |
|
|
<span>Expand source code</span>
|
565 |
|
|
</summary>
|
566 |
|
|
<pre><code class="python">def create_team(db: Session, name: str):
|
567 |
|
|
"""
|
568 |
|
|
Creates new team with given name
|
569 |
|
|
"""
|
570 |
|
|
db_team = models.Team(name=name)
|
571 |
|
|
db.add(db_team)
|
572 |
|
|
db.commit()
|
573 |
|
|
db.refresh(db_team)
|
574 |
|
|
return db_team</code></pre>
|
575 |
|
|
</details>
|
576 |
|
|
</dd>
|
577 |
|
|
<dt id="sql_app.crud.find_body_device"><code class="name flex">
|
578 |
|
|
<span>def <span class="ident">find_body_device</span></span>(<span>db: sqlalchemy.orm.session.Session, serial: <a title="sql_app.schemas.BodyDeviceBase" href="schemas.html#sql_app.schemas.BodyDeviceBase">BodyDeviceBase</a>)</span>
|
579 |
|
|
</code></dt>
|
580 |
|
|
<dd>
|
581 |
|
|
<div class="desc"><p>Finds one body device by its serial number</p></div>
|
582 |
|
|
<details class="source">
|
583 |
|
|
<summary>
|
584 |
|
|
<span>Expand source code</span>
|
585 |
|
|
</summary>
|
586 |
|
|
<pre><code class="python">def find_body_device(db: Session, serial: schemas.BodyDeviceBase):
|
587 |
|
|
"""
|
588 |
|
|
Finds one body device by its serial number
|
589 |
|
|
"""
|
590 |
|
|
return db.query(models.BodyDevice).filter(models.BodyDevice.serial_number == serial.serial_number).first()</code></pre>
|
591 |
|
|
</details>
|
592 |
|
|
</dd>
|
593 |
|
|
<dt id="sql_app.crud.find_device"><code class="name flex">
|
594 |
|
|
<span>def <span class="ident">find_device</span></span>(<span>db: sqlalchemy.orm.session.Session, device: <a title="sql_app.schemas.DeviceBase" href="schemas.html#sql_app.schemas.DeviceBase">DeviceBase</a>)</span>
|
595 |
|
|
</code></dt>
|
596 |
|
|
<dd>
|
597 |
|
|
<div class="desc"><p>finds one device with product_id, vendor_id and serial_number same as in given DeviceBase object</p></div>
|
598 |
|
|
<details class="source">
|
599 |
|
|
<summary>
|
600 |
|
|
<span>Expand source code</span>
|
601 |
|
|
</summary>
|
602 |
|
|
<pre><code class="python">def find_device(db: Session, device: schemas.DeviceBase):
|
603 |
|
|
"""
|
604 |
|
|
finds one device with product_id, vendor_id and serial_number same as in given DeviceBase object
|
605 |
|
|
"""
|
606 |
|
|
return db.query(models.Device).filter(and_(models.Device.product_id == device.product_id,
|
607 |
|
|
models.Device.vendor_id == device.vendor_id,
|
608 |
|
|
models.Device.serial_number == device.serial_number)).first()</code></pre>
|
609 |
|
|
</details>
|
610 |
|
|
</dd>
|
611 |
|
|
<dt id="sql_app.crud.find_filtered_logs"><code class="name flex">
|
612 |
|
|
<span>def <span class="ident">find_filtered_logs</span></span>(<span>db: sqlalchemy.orm.session.Session, logs: [])</span>
|
613 |
|
|
</code></dt>
|
614 |
|
|
<dd>
|
615 |
|
|
<div class="desc"><p>Returns all usb logs with ids in given id array.</p></div>
|
616 |
|
|
<details class="source">
|
617 |
|
|
<summary>
|
618 |
|
|
<span>Expand source code</span>
|
619 |
|
|
</summary>
|
620 |
|
|
<pre><code class="python">def find_filtered_logs(db: Session, logs: []):
|
621 |
|
|
"""
|
622 |
|
|
Returns all usb logs with ids in given id array.
|
623 |
|
|
"""
|
624 |
|
|
return db.query(models.USBLog).filter(models.USBLog.id.in_(logs)).order_by(desc(models.USBLog.timestamp)).all()</code></pre>
|
625 |
|
|
</details>
|
626 |
|
|
</dd>
|
627 |
|
|
<dt id="sql_app.crud.find_head_device"><code class="name flex">
|
628 |
|
|
<span>def <span class="ident">find_head_device</span></span>(<span>db: sqlalchemy.orm.session.Session, serial: <a title="sql_app.schemas.HeadDeviceBase" href="schemas.html#sql_app.schemas.HeadDeviceBase">HeadDeviceBase</a>)</span>
|
629 |
|
|
</code></dt>
|
630 |
|
|
<dd>
|
631 |
|
|
<div class="desc"><p>Finds one head device by its serial number</p></div>
|
632 |
|
|
<details class="source">
|
633 |
|
|
<summary>
|
634 |
|
|
<span>Expand source code</span>
|
635 |
|
|
</summary>
|
636 |
|
|
<pre><code class="python">def find_head_device(db: Session, serial: schemas.HeadDeviceBase):
|
637 |
|
|
"""
|
638 |
|
|
Finds one head device by its serial number
|
639 |
|
|
"""
|
640 |
|
|
return db.query(models.HeadDevice).filter(models.HeadDevice.serial_number == serial.serial_number).first()</code></pre>
|
641 |
|
|
</details>
|
642 |
|
|
</dd>
|
643 |
|
|
<dt id="sql_app.crud.find_license"><code class="name flex">
|
644 |
|
|
<span>def <span class="ident">find_license</span></span>(<span>db: sqlalchemy.orm.session.Session, name: str)</span>
|
645 |
|
|
</code></dt>
|
646 |
|
|
<dd>
|
647 |
|
|
<div class="desc"><p>finds one license by given string name</p></div>
|
648 |
|
|
<details class="source">
|
649 |
|
|
<summary>
|
650 |
|
|
<span>Expand source code</span>
|
651 |
|
|
</summary>
|
652 |
|
|
<pre><code class="python">def find_license(db: Session, name: str):
|
653 |
|
|
"""
|
654 |
|
|
finds one license by given string name
|
655 |
|
|
"""
|
656 |
|
|
return db.query(models.License).filter(models.License.name == name).first()</code></pre>
|
657 |
|
|
</details>
|
658 |
|
|
</dd>
|
659 |
|
|
<dt id="sql_app.crud.find_pc"><code class="name flex">
|
660 |
|
|
<span>def <span class="ident">find_pc</span></span>(<span>db: sqlalchemy.orm.session.Session, username: str, hostname: str)</span>
|
661 |
|
|
</code></dt>
|
662 |
|
|
<dd>
|
663 |
|
|
<div class="desc"><p>Finds one pc with given username and hostname</p></div>
|
664 |
|
|
<details class="source">
|
665 |
|
|
<summary>
|
666 |
|
|
<span>Expand source code</span>
|
667 |
|
|
</summary>
|
668 |
|
|
<pre><code class="python">def find_pc(db: Session, username: str, hostname: str):
|
669 |
|
|
"""
|
670 |
|
|
Finds one pc with given username and hostname
|
671 |
|
|
"""
|
672 |
|
|
return db.query(models.PC).filter(and_(models.PC.username == username,
|
673 |
|
|
models.PC.hostname == hostname)).first()</code></pre>
|
674 |
|
|
</details>
|
675 |
|
|
</dd>
|
676 |
|
|
<dt id="sql_app.crud.find_pc_by_name"><code class="name flex">
|
677 |
|
|
<span>def <span class="ident">find_pc_by_name</span></span>(<span>db: sqlalchemy.orm.session.Session, username: str)</span>
|
678 |
|
|
</code></dt>
|
679 |
|
|
<dd>
|
680 |
|
|
<div class="desc"><p>Finds one pc by its username</p></div>
|
681 |
|
|
<details class="source">
|
682 |
|
|
<summary>
|
683 |
|
|
<span>Expand source code</span>
|
684 |
|
|
</summary>
|
685 |
|
|
<pre><code class="python">def find_pc_by_name(db: Session, username: str):
|
686 |
|
|
"""
|
687 |
|
|
Finds one pc by its username
|
688 |
|
|
"""
|
689 |
|
|
return db.query(models.PC).filter(models.PC.username == username).first()</code></pre>
|
690 |
|
|
</details>
|
691 |
|
|
</dd>
|
692 |
|
|
<dt id="sql_app.crud.find_pc_by_name_all"><code class="name flex">
|
693 |
|
|
<span>def <span class="ident">find_pc_by_name_all</span></span>(<span>db: sqlalchemy.orm.session.Session, username: str)</span>
|
694 |
|
|
</code></dt>
|
695 |
|
|
<dd>
|
696 |
|
|
<div class="desc"><p>Finds all pcs with same username</p></div>
|
697 |
|
|
<details class="source">
|
698 |
|
|
<summary>
|
699 |
|
|
<span>Expand source code</span>
|
700 |
|
|
</summary>
|
701 |
|
|
<pre><code class="python">def find_pc_by_name_all(db: Session, username: str):
|
702 |
|
|
"""
|
703 |
|
|
Finds all pcs with same username
|
704 |
|
|
"""
|
705 |
|
|
return db.query(models.PC).filter(models.PC.username == username).offset(0).limit(100).all()</code></pre>
|
706 |
|
|
</details>
|
707 |
|
|
</dd>
|
708 |
|
|
<dt id="sql_app.crud.find_pc_by_username"><code class="name flex">
|
709 |
|
|
<span>def <span class="ident">find_pc_by_username</span></span>(<span>db: sqlalchemy.orm.session.Session, name: str)</span>
|
710 |
|
|
</code></dt>
|
711 |
|
|
<dd>
|
712 |
|
|
<div class="desc"><p>Finds one pc by given username</p></div>
|
713 |
|
|
<details class="source">
|
714 |
|
|
<summary>
|
715 |
|
|
<span>Expand source code</span>
|
716 |
|
|
</summary>
|
717 |
|
|
<pre><code class="python">def find_pc_by_username(db: Session, name: str):
|
718 |
|
|
"""
|
719 |
|
|
Finds one pc by given username
|
720 |
|
|
"""
|
721 |
|
|
return db.query(models.PC).filter(models.PC.username == name).first()</code></pre>
|
722 |
|
|
</details>
|
723 |
|
|
</dd>
|
724 |
|
|
<dt id="sql_app.crud.find_pcs"><code class="name flex">
|
725 |
|
|
<span>def <span class="ident">find_pcs</span></span>(<span>db: sqlalchemy.orm.session.Session, pcs: [])</span>
|
726 |
|
|
</code></dt>
|
727 |
|
|
<dd>
|
728 |
|
|
<div class="desc"><p>Finds all pcs with ids in given id array</p></div>
|
729 |
|
|
<details class="source">
|
730 |
|
|
<summary>
|
731 |
|
|
<span>Expand source code</span>
|
732 |
|
|
</summary>
|
733 |
|
|
<pre><code class="python">def find_pcs(db: Session, pcs: []):
|
734 |
|
|
"""
|
735 |
|
|
Finds all pcs with ids in given id array
|
736 |
|
|
"""
|
737 |
|
|
return db.query(models.PC).filter(models.PC.id.in_(pcs)).all()</code></pre>
|
738 |
|
|
</details>
|
739 |
|
|
</dd>
|
740 |
|
|
<dt id="sql_app.crud.find_team"><code class="name flex">
|
741 |
|
|
<span>def <span class="ident">find_team</span></span>(<span>db: sqlalchemy.orm.session.Session, name: str)</span>
|
742 |
|
|
</code></dt>
|
743 |
|
|
<dd>
|
744 |
|
|
<div class="desc"><p>Finds one specific team by its name</p></div>
|
745 |
|
|
<details class="source">
|
746 |
|
|
<summary>
|
747 |
|
|
<span>Expand source code</span>
|
748 |
|
|
</summary>
|
749 |
|
|
<pre><code class="python">def find_team(db: Session, name: str):
|
750 |
|
|
"""
|
751 |
|
|
Finds one specific team by its name
|
752 |
|
|
"""
|
753 |
|
|
return db.query(models.Team).filter(models.Team.name == name).first()</code></pre>
|
754 |
|
|
</details>
|
755 |
|
|
</dd>
|
756 |
|
|
<dt id="sql_app.crud.get_body_device"><code class="name flex">
|
757 |
|
|
<span>def <span class="ident">get_body_device</span></span>(<span>db: sqlalchemy.orm.session.Session, body_id: int)</span>
|
758 |
|
|
</code></dt>
|
759 |
|
|
<dd>
|
760 |
|
|
<div class="desc"><p>Returns one specific body device by given id</p></div>
|
761 |
|
|
<details class="source">
|
762 |
|
|
<summary>
|
763 |
|
|
<span>Expand source code</span>
|
764 |
|
|
</summary>
|
765 |
|
|
<pre><code class="python">def get_body_device(db: Session, body_id: int):
|
766 |
|
|
"""
|
767 |
|
|
Returns one specific body device by given id
|
768 |
|
|
"""
|
769 |
|
|
return db.query(models.BodyDevice).filter(models.BodyDevice.id == body_id).first()</code></pre>
|
770 |
|
|
</details>
|
771 |
|
|
</dd>
|
772 |
|
|
<dt id="sql_app.crud.get_body_devices"><code class="name flex">
|
773 |
|
|
<span>def <span class="ident">get_body_devices</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
774 |
|
|
</code></dt>
|
775 |
|
|
<dd>
|
776 |
|
|
<div class="desc"><p>Returns all body devices saved in database</p></div>
|
777 |
|
|
<details class="source">
|
778 |
|
|
<summary>
|
779 |
|
|
<span>Expand source code</span>
|
780 |
|
|
</summary>
|
781 |
|
|
<pre><code class="python">def get_body_devices(db: Session, skip: int = 0, limit: int = 100):
|
782 |
|
|
"""
|
783 |
|
|
Returns all body devices saved in database
|
784 |
|
|
"""
|
785 |
|
|
return db.query(models.BodyDevice).offset(skip).limit(limit).all()</code></pre>
|
786 |
|
|
</details>
|
787 |
|
|
</dd>
|
788 |
|
|
<dt id="sql_app.crud.get_device"><code class="name flex">
|
789 |
|
|
<span>def <span class="ident">get_device</span></span>(<span>db: sqlalchemy.orm.session.Session, device_id: int)</span>
|
790 |
|
|
</code></dt>
|
791 |
|
|
<dd>
|
792 |
|
|
<div class="desc"><p>returns one specific devices by given id</p></div>
|
793 |
|
|
<details class="source">
|
794 |
|
|
<summary>
|
795 |
|
|
<span>Expand source code</span>
|
796 |
|
|
</summary>
|
797 |
|
|
<pre><code class="python">def get_device(db: Session, device_id: int):
|
798 |
|
|
"""
|
799 |
|
|
returns one specific devices by given id
|
800 |
|
|
"""
|
801 |
|
|
return db.query(models.Device).filter(models.Device.id == device_id).first()</code></pre>
|
802 |
|
|
</details>
|
803 |
|
|
</dd>
|
804 |
|
|
<dt id="sql_app.crud.get_devices"><code class="name flex">
|
805 |
|
|
<span>def <span class="ident">get_devices</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
806 |
|
|
</code></dt>
|
807 |
|
|
<dd>
|
808 |
|
|
<div class="desc"><p>returns all devices in database</p></div>
|
809 |
|
|
<details class="source">
|
810 |
|
|
<summary>
|
811 |
|
|
<span>Expand source code</span>
|
812 |
|
|
</summary>
|
813 |
|
|
<pre><code class="python">def get_devices(db: Session, skip: int = 0, limit: int = 100):
|
814 |
|
|
"""
|
815 |
|
|
returns all devices in database
|
816 |
|
|
"""
|
817 |
|
|
return db.query(models.Device).offset(skip).limit(limit).all()</code></pre>
|
818 |
|
|
</details>
|
819 |
|
|
</dd>
|
820 |
|
|
<dt id="sql_app.crud.get_filtered_logs"><code class="name flex">
|
821 |
|
|
<span>def <span class="ident">get_filtered_logs</span></span>(<span>db: sqlalchemy.orm.session.Session, pc: str, tema: str, lic: str)</span>
|
822 |
|
|
</code></dt>
|
823 |
|
|
<dd>
|
824 |
|
|
<div class="desc"><p>Function creates query string used for filtering by pc username, team name and license name.
|
825 |
|
|
Depending on selected filters assembles query string for database</p></div>
|
826 |
|
|
<details class="source">
|
827 |
|
|
<summary>
|
828 |
|
|
<span>Expand source code</span>
|
829 |
|
|
</summary>
|
830 |
|
|
<pre><code class="python">def get_filtered_logs(db: Session, pc: str, tema: str, lic: str):
|
831 |
|
|
"""
|
832 |
|
|
Function creates query string used for filtering by pc username, team name and license name.
|
833 |
|
|
Depending on selected filters assembles query string for database
|
834 |
|
|
"""
|
835 |
|
|
execute_string = "SELECT * FROM usb_logs AS logs"
|
836 |
|
|
if pc != "all":
|
837 |
|
|
pcs = find_pc_by_username(db, pc)
|
838 |
|
|
execute_string += " WHERE logs.pc_id = " + str(pcs.id)
|
839 |
|
|
if tema != "all":
|
840 |
|
|
team = find_team(db, tema)
|
841 |
|
|
pcs = get_pcs_by_team(db, team.id)
|
842 |
|
|
pc_ids = "("
|
843 |
|
|
for p in pcs:
|
844 |
|
|
pc_ids += str(p.id) + ", "
|
845 |
|
|
def_pc_ids = pc_ids[:-2] + ")"
|
846 |
|
|
if pc != "all":
|
847 |
|
|
execute_string += " AND logs.pc_id IN " + def_pc_ids
|
848 |
|
|
else:
|
849 |
|
|
execute_string += " WHERE logs.pc_id IN " + def_pc_ids
|
850 |
|
|
if lic != "all":
|
851 |
|
|
license = find_license(db, lic)
|
852 |
|
|
device_licenses = get_license_devices(db, license.id)
|
853 |
|
|
dev_ids = "("
|
854 |
|
|
for dev in device_licenses:
|
855 |
|
|
dev_ids += str(dev.device_id) + ", "
|
856 |
|
|
defin_ids = dev_ids[:-2] + ")"
|
857 |
|
|
if pc != "all" or tema != "all":
|
858 |
|
|
execute_string += " AND logs.device_id IN " + defin_ids
|
859 |
|
|
else:
|
860 |
|
|
execute_string += " WHERE logs.device_id IN " + defin_ids
|
861 |
|
|
|
862 |
|
|
# executing assembled query string
|
863 |
|
|
result = db.execute(execute_string)
|
864 |
|
|
return result</code></pre>
|
865 |
|
|
</details>
|
866 |
|
|
</dd>
|
867 |
|
|
<dt id="sql_app.crud.get_head_device"><code class="name flex">
|
868 |
|
|
<span>def <span class="ident">get_head_device</span></span>(<span>db: sqlalchemy.orm.session.Session, head_id: int)</span>
|
869 |
|
|
</code></dt>
|
870 |
|
|
<dd>
|
871 |
|
|
<div class="desc"><p>Returns one specific head device by given id</p></div>
|
872 |
|
|
<details class="source">
|
873 |
|
|
<summary>
|
874 |
|
|
<span>Expand source code</span>
|
875 |
|
|
</summary>
|
876 |
|
|
<pre><code class="python">def get_head_device(db: Session, head_id: int):
|
877 |
|
|
"""
|
878 |
|
|
Returns one specific head device by given id
|
879 |
|
|
"""
|
880 |
|
|
return db.query(models.HeadDevice).filter(models.HeadDevice.id == head_id).first()</code></pre>
|
881 |
|
|
</details>
|
882 |
|
|
</dd>
|
883 |
|
|
<dt id="sql_app.crud.get_head_devices"><code class="name flex">
|
884 |
|
|
<span>def <span class="ident">get_head_devices</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
885 |
|
|
</code></dt>
|
886 |
|
|
<dd>
|
887 |
|
|
<div class="desc"><p>Returns all head devices saved in database</p></div>
|
888 |
|
|
<details class="source">
|
889 |
|
|
<summary>
|
890 |
|
|
<span>Expand source code</span>
|
891 |
|
|
</summary>
|
892 |
|
|
<pre><code class="python">def get_head_devices(db: Session, skip: int = 0, limit: int = 100):
|
893 |
|
|
"""
|
894 |
|
|
Returns all head devices saved in database
|
895 |
|
|
"""
|
896 |
|
|
return db.query(models.HeadDevice).offset(skip).limit(limit).all()</code></pre>
|
897 |
|
|
</details>
|
898 |
|
|
</dd>
|
899 |
|
|
<dt id="sql_app.crud.get_ld_logs"><code class="name flex">
|
900 |
|
|
<span>def <span class="ident">get_ld_logs</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
901 |
|
|
</code></dt>
|
902 |
|
|
<dd>
|
903 |
|
|
<div class="desc"><p>Returns all ld debugger logs in database</p></div>
|
904 |
|
|
<details class="source">
|
905 |
|
|
<summary>
|
906 |
|
|
<span>Expand source code</span>
|
907 |
|
|
</summary>
|
908 |
|
|
<pre><code class="python">def get_ld_logs(db: Session, skip: int = 0, limit: int = 100):
|
909 |
|
|
"""
|
910 |
|
|
Returns all ld debugger logs in database
|
911 |
|
|
"""
|
912 |
|
|
return db.query(models.LDLog).offset(skip).limit(limit).all()</code></pre>
|
913 |
|
|
</details>
|
914 |
|
|
</dd>
|
915 |
|
|
<dt id="sql_app.crud.get_license"><code class="name flex">
|
916 |
|
|
<span>def <span class="ident">get_license</span></span>(<span>db: sqlalchemy.orm.session.Session, license_id: int)</span>
|
917 |
|
|
</code></dt>
|
918 |
|
|
<dd>
|
919 |
|
|
<div class="desc"><p>returns one specific license by given id</p></div>
|
920 |
|
|
<details class="source">
|
921 |
|
|
<summary>
|
922 |
|
|
<span>Expand source code</span>
|
923 |
|
|
</summary>
|
924 |
|
|
<pre><code class="python">def get_license(db: Session, license_id: int):
|
925 |
|
|
"""
|
926 |
|
|
returns one specific license by given id
|
927 |
|
|
"""
|
928 |
|
|
return db.query(models.License).filter(models.License.id == license_id).first()</code></pre>
|
929 |
|
|
</details>
|
930 |
|
|
</dd>
|
931 |
|
|
<dt id="sql_app.crud.get_license_devices"><code class="name flex">
|
932 |
|
|
<span>def <span class="ident">get_license_devices</span></span>(<span>db: sqlalchemy.orm.session.Session, license_id: int)</span>
|
933 |
|
|
</code></dt>
|
934 |
|
|
<dd>
|
935 |
|
|
<div class="desc"><p>returns all entries in devices_licenses table</p></div>
|
936 |
|
|
<details class="source">
|
937 |
|
|
<summary>
|
938 |
|
|
<span>Expand source code</span>
|
939 |
|
|
</summary>
|
940 |
|
|
<pre><code class="python">def get_license_devices(db: Session, license_id: int):
|
941 |
|
|
"""
|
942 |
|
|
returns all entries in devices_licenses table
|
943 |
|
|
"""
|
944 |
|
|
return db.query(models.DeviceLicense).filter(models.DeviceLicense.license_id == license_id).all()</code></pre>
|
945 |
|
|
</details>
|
946 |
|
|
</dd>
|
947 |
|
|
<dt id="sql_app.crud.get_licenses"><code class="name flex">
|
948 |
|
|
<span>def <span class="ident">get_licenses</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
949 |
|
|
</code></dt>
|
950 |
|
|
<dd>
|
951 |
|
|
<div class="desc"><p>returns all licenses in database</p></div>
|
952 |
|
|
<details class="source">
|
953 |
|
|
<summary>
|
954 |
|
|
<span>Expand source code</span>
|
955 |
|
|
</summary>
|
956 |
|
|
<pre><code class="python">def get_licenses(db: Session, skip: int = 0, limit: int = 100):
|
957 |
|
|
"""
|
958 |
|
|
returns all licenses in database
|
959 |
|
|
"""
|
960 |
|
|
return db.query(models.License).offset(skip).limit(limit).all()</code></pre>
|
961 |
|
|
</details>
|
962 |
|
|
</dd>
|
963 |
|
|
<dt id="sql_app.crud.get_log"><code class="name flex">
|
964 |
|
|
<span>def <span class="ident">get_log</span></span>(<span>db: sqlalchemy.orm.session.Session, device_id: int, skip: int = 0, limit: int = 100)</span>
|
965 |
|
|
</code></dt>
|
966 |
|
|
<dd>
|
967 |
|
|
<div class="desc"><p>Returns all usb logs in database sorted by id</p></div>
|
968 |
|
|
<details class="source">
|
969 |
|
|
<summary>
|
970 |
|
|
<span>Expand source code</span>
|
971 |
|
|
</summary>
|
972 |
|
|
<pre><code class="python">def get_log(db: Session, device_id: int, skip: int = 0, limit: int = 100):
|
973 |
|
|
"""
|
974 |
|
|
Returns all usb logs in database sorted by id
|
975 |
|
|
"""
|
976 |
|
|
return db.query(models.USBLog).filter(models.USBLog.device_id == device_id).offset(skip).limit(limit).all()</code></pre>
|
977 |
|
|
</details>
|
978 |
|
|
</dd>
|
979 |
|
|
<dt id="sql_app.crud.get_logs"><code class="name flex">
|
980 |
|
|
<span>def <span class="ident">get_logs</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
981 |
|
|
</code></dt>
|
982 |
|
|
<dd>
|
983 |
|
|
<div class="desc"><p>Returns all usb logs in database ordered by timestamp</p></div>
|
984 |
|
|
<details class="source">
|
985 |
|
|
<summary>
|
986 |
|
|
<span>Expand source code</span>
|
987 |
|
|
</summary>
|
988 |
|
|
<pre><code class="python">def get_logs(db: Session, skip: int = 0, limit: int = 100):
|
989 |
|
|
"""
|
990 |
|
|
Returns all usb logs in database ordered by timestamp
|
991 |
|
|
"""
|
992 |
|
|
return db.query(models.USBLog).order_by(desc(models.USBLog.timestamp)).offset(skip).limit(limit).all()</code></pre>
|
993 |
|
|
</details>
|
994 |
|
|
</dd>
|
995 |
|
|
<dt id="sql_app.crud.get_pc"><code class="name flex">
|
996 |
|
|
<span>def <span class="ident">get_pc</span></span>(<span>db: sqlalchemy.orm.session.Session, pc_id: int)</span>
|
997 |
|
|
</code></dt>
|
998 |
|
|
<dd>
|
999 |
|
|
<div class="desc"><p>returns one specific pc by given id</p></div>
|
1000 |
|
|
<details class="source">
|
1001 |
|
|
<summary>
|
1002 |
|
|
<span>Expand source code</span>
|
1003 |
|
|
</summary>
|
1004 |
|
|
<pre><code class="python">def get_pc(db: Session, pc_id: int):
|
1005 |
|
|
"""
|
1006 |
|
|
returns one specific pc by given id
|
1007 |
|
|
"""
|
1008 |
|
|
return db.query(models.PC).filter(models.PC.id == pc_id).first()</code></pre>
|
1009 |
|
|
</details>
|
1010 |
|
|
</dd>
|
1011 |
|
|
<dt id="sql_app.crud.get_pcs"><code class="name flex">
|
1012 |
|
|
<span>def <span class="ident">get_pcs</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
1013 |
|
|
</code></dt>
|
1014 |
|
|
<dd>
|
1015 |
|
|
<div class="desc"><p>returns all pcs in database</p></div>
|
1016 |
|
|
<details class="source">
|
1017 |
|
|
<summary>
|
1018 |
|
|
<span>Expand source code</span>
|
1019 |
|
|
</summary>
|
1020 |
|
|
<pre><code class="python">def get_pcs(db: Session, skip: int = 0, limit: int = 100):
|
1021 |
|
|
"""
|
1022 |
|
|
returns all pcs in database
|
1023 |
|
|
"""
|
1024 |
|
|
return db.query(models.PC).offset(skip).limit(limit).all()</code></pre>
|
1025 |
|
|
</details>
|
1026 |
|
|
</dd>
|
1027 |
|
|
<dt id="sql_app.crud.get_pcs_by_team"><code class="name flex">
|
1028 |
|
|
<span>def <span class="ident">get_pcs_by_team</span></span>(<span>db: sqlalchemy.orm.session.Session, team_id: int)</span>
|
1029 |
|
|
</code></dt>
|
1030 |
|
|
<dd>
|
1031 |
|
|
<div class="desc"><p>returns all pcs in given team by team id</p></div>
|
1032 |
|
|
<details class="source">
|
1033 |
|
|
<summary>
|
1034 |
|
|
<span>Expand source code</span>
|
1035 |
|
|
</summary>
|
1036 |
|
|
<pre><code class="python">def get_pcs_by_team(db: Session, team_id: int):
|
1037 |
|
|
"""
|
1038 |
|
|
returns all pcs in given team by team id
|
1039 |
|
|
"""
|
1040 |
|
|
return db.query(models.PC).filter(models.PC.team_id == team_id).all()</code></pre>
|
1041 |
|
|
</details>
|
1042 |
|
|
</dd>
|
1043 |
|
|
<dt id="sql_app.crud.get_team"><code class="name flex">
|
1044 |
|
|
<span>def <span class="ident">get_team</span></span>(<span>db: sqlalchemy.orm.session.Session, team_id: int)</span>
|
1045 |
|
|
</code></dt>
|
1046 |
|
|
<dd>
|
1047 |
|
|
<div class="desc"><p>returns one specific team wit given id</p></div>
|
1048 |
|
|
<details class="source">
|
1049 |
|
|
<summary>
|
1050 |
|
|
<span>Expand source code</span>
|
1051 |
|
|
</summary>
|
1052 |
|
|
<pre><code class="python">def get_team(db: Session, team_id: int):
|
1053 |
|
|
"""
|
1054 |
|
|
returns one specific team wit given id
|
1055 |
|
|
"""
|
1056 |
|
|
return db.query(models.Team).filter(models.Team.id == team_id).first()</code></pre>
|
1057 |
|
|
</details>
|
1058 |
|
|
</dd>
|
1059 |
|
|
<dt id="sql_app.crud.get_teams"><code class="name flex">
|
1060 |
|
|
<span>def <span class="ident">get_teams</span></span>(<span>db: sqlalchemy.orm.session.Session, skip: int = 0, limit: int = 100)</span>
|
1061 |
|
|
</code></dt>
|
1062 |
|
|
<dd>
|
1063 |
|
|
<div class="desc"><p>returns all teams currently saved in database</p></div>
|
1064 |
|
|
<details class="source">
|
1065 |
|
|
<summary>
|
1066 |
|
|
<span>Expand source code</span>
|
1067 |
|
|
</summary>
|
1068 |
|
|
<pre><code class="python">def get_teams(db: Session, skip: int = 0, limit: int = 100):
|
1069 |
|
|
"""
|
1070 |
|
|
returns all teams currently saved in database
|
1071 |
|
|
"""
|
1072 |
|
|
return db.query(models.Team).offset(skip).limit(limit).all()</code></pre>
|
1073 |
|
|
</details>
|
1074 |
|
|
</dd>
|
1075 |
|
|
<dt id="sql_app.crud.update_pc"><code class="name flex">
|
1076 |
|
|
<span>def <span class="ident">update_pc</span></span>(<span>db: sqlalchemy.orm.session.Session, pc_id: int, team: str)</span>
|
1077 |
|
|
</code></dt>
|
1078 |
|
|
<dd>
|
1079 |
|
|
<div class="desc"><p>Function updates team of one specific pc</p></div>
|
1080 |
|
|
<details class="source">
|
1081 |
|
|
<summary>
|
1082 |
|
|
<span>Expand source code</span>
|
1083 |
|
|
</summary>
|
1084 |
|
|
<pre><code class="python">def update_pc(db: Session, pc_id: int, team: str):
|
1085 |
|
|
"""
|
1086 |
|
|
Function updates team of one specific pc
|
1087 |
|
|
"""
|
1088 |
|
|
old_pc = get_pc(db, pc_id)
|
1089 |
|
|
team = get_team(db, int(team))
|
1090 |
|
|
new = {'id': old_pc.id, 'username': old_pc.username, 'hostname': old_pc.hostname, 'assigned': True,
|
1091 |
|
|
'team_id': team.id}
|
1092 |
|
|
for key, value in new.items():
|
1093 |
|
|
setattr(old_pc, key, value)
|
1094 |
|
|
db.commit()
|
1095 |
|
|
db.refresh(old_pc)
|
1096 |
|
|
return old_pc</code></pre>
|
1097 |
|
|
</details>
|
1098 |
|
|
</dd>
|
1099 |
|
|
</dl>
|
1100 |
|
|
</section>
|
1101 |
|
|
<section>
|
1102 |
|
|
</section>
|
1103 |
|
|
</article>
|
1104 |
|
|
<nav id="sidebar">
|
1105 |
|
|
<h1>Index</h1>
|
1106 |
|
|
<div class="toc">
|
1107 |
|
|
<ul></ul>
|
1108 |
|
|
</div>
|
1109 |
|
|
<ul id="index">
|
1110 |
|
|
<li><h3>Super-module</h3>
|
1111 |
|
|
<ul>
|
1112 |
|
|
<li><code><a title="sql_app" href="index.html">sql_app</a></code></li>
|
1113 |
|
|
</ul>
|
1114 |
|
|
</li>
|
1115 |
|
|
<li><h3><a href="#header-functions">Functions</a></h3>
|
1116 |
|
|
<ul class="">
|
1117 |
|
|
<li><code><a title="sql_app.crud.create_body_device" href="#sql_app.crud.create_body_device">create_body_device</a></code></li>
|
1118 |
|
|
<li><code><a title="sql_app.crud.create_device" href="#sql_app.crud.create_device">create_device</a></code></li>
|
1119 |
|
|
<li><code><a title="sql_app.crud.create_device_license" href="#sql_app.crud.create_device_license">create_device_license</a></code></li>
|
1120 |
|
|
<li><code><a title="sql_app.crud.create_device_logs" href="#sql_app.crud.create_device_logs">create_device_logs</a></code></li>
|
1121 |
|
|
<li><code><a title="sql_app.crud.create_head_device" href="#sql_app.crud.create_head_device">create_head_device</a></code></li>
|
1122 |
|
|
<li><code><a title="sql_app.crud.create_ld_logs" href="#sql_app.crud.create_ld_logs">create_ld_logs</a></code></li>
|
1123 |
|
|
<li><code><a title="sql_app.crud.create_license" href="#sql_app.crud.create_license">create_license</a></code></li>
|
1124 |
|
|
<li><code><a title="sql_app.crud.create_pc" href="#sql_app.crud.create_pc">create_pc</a></code></li>
|
1125 |
|
|
<li><code><a title="sql_app.crud.create_team" href="#sql_app.crud.create_team">create_team</a></code></li>
|
1126 |
|
|
<li><code><a title="sql_app.crud.find_body_device" href="#sql_app.crud.find_body_device">find_body_device</a></code></li>
|
1127 |
|
|
<li><code><a title="sql_app.crud.find_device" href="#sql_app.crud.find_device">find_device</a></code></li>
|
1128 |
|
|
<li><code><a title="sql_app.crud.find_filtered_logs" href="#sql_app.crud.find_filtered_logs">find_filtered_logs</a></code></li>
|
1129 |
|
|
<li><code><a title="sql_app.crud.find_head_device" href="#sql_app.crud.find_head_device">find_head_device</a></code></li>
|
1130 |
|
|
<li><code><a title="sql_app.crud.find_license" href="#sql_app.crud.find_license">find_license</a></code></li>
|
1131 |
|
|
<li><code><a title="sql_app.crud.find_pc" href="#sql_app.crud.find_pc">find_pc</a></code></li>
|
1132 |
|
|
<li><code><a title="sql_app.crud.find_pc_by_name" href="#sql_app.crud.find_pc_by_name">find_pc_by_name</a></code></li>
|
1133 |
|
|
<li><code><a title="sql_app.crud.find_pc_by_name_all" href="#sql_app.crud.find_pc_by_name_all">find_pc_by_name_all</a></code></li>
|
1134 |
|
|
<li><code><a title="sql_app.crud.find_pc_by_username" href="#sql_app.crud.find_pc_by_username">find_pc_by_username</a></code></li>
|
1135 |
|
|
<li><code><a title="sql_app.crud.find_pcs" href="#sql_app.crud.find_pcs">find_pcs</a></code></li>
|
1136 |
|
|
<li><code><a title="sql_app.crud.find_team" href="#sql_app.crud.find_team">find_team</a></code></li>
|
1137 |
|
|
<li><code><a title="sql_app.crud.get_body_device" href="#sql_app.crud.get_body_device">get_body_device</a></code></li>
|
1138 |
|
|
<li><code><a title="sql_app.crud.get_body_devices" href="#sql_app.crud.get_body_devices">get_body_devices</a></code></li>
|
1139 |
|
|
<li><code><a title="sql_app.crud.get_device" href="#sql_app.crud.get_device">get_device</a></code></li>
|
1140 |
|
|
<li><code><a title="sql_app.crud.get_devices" href="#sql_app.crud.get_devices">get_devices</a></code></li>
|
1141 |
|
|
<li><code><a title="sql_app.crud.get_filtered_logs" href="#sql_app.crud.get_filtered_logs">get_filtered_logs</a></code></li>
|
1142 |
|
|
<li><code><a title="sql_app.crud.get_head_device" href="#sql_app.crud.get_head_device">get_head_device</a></code></li>
|
1143 |
|
|
<li><code><a title="sql_app.crud.get_head_devices" href="#sql_app.crud.get_head_devices">get_head_devices</a></code></li>
|
1144 |
|
|
<li><code><a title="sql_app.crud.get_ld_logs" href="#sql_app.crud.get_ld_logs">get_ld_logs</a></code></li>
|
1145 |
|
|
<li><code><a title="sql_app.crud.get_license" href="#sql_app.crud.get_license">get_license</a></code></li>
|
1146 |
|
|
<li><code><a title="sql_app.crud.get_license_devices" href="#sql_app.crud.get_license_devices">get_license_devices</a></code></li>
|
1147 |
|
|
<li><code><a title="sql_app.crud.get_licenses" href="#sql_app.crud.get_licenses">get_licenses</a></code></li>
|
1148 |
|
|
<li><code><a title="sql_app.crud.get_log" href="#sql_app.crud.get_log">get_log</a></code></li>
|
1149 |
|
|
<li><code><a title="sql_app.crud.get_logs" href="#sql_app.crud.get_logs">get_logs</a></code></li>
|
1150 |
|
|
<li><code><a title="sql_app.crud.get_pc" href="#sql_app.crud.get_pc">get_pc</a></code></li>
|
1151 |
|
|
<li><code><a title="sql_app.crud.get_pcs" href="#sql_app.crud.get_pcs">get_pcs</a></code></li>
|
1152 |
|
|
<li><code><a title="sql_app.crud.get_pcs_by_team" href="#sql_app.crud.get_pcs_by_team">get_pcs_by_team</a></code></li>
|
1153 |
|
|
<li><code><a title="sql_app.crud.get_team" href="#sql_app.crud.get_team">get_team</a></code></li>
|
1154 |
|
|
<li><code><a title="sql_app.crud.get_teams" href="#sql_app.crud.get_teams">get_teams</a></code></li>
|
1155 |
|
|
<li><code><a title="sql_app.crud.update_pc" href="#sql_app.crud.update_pc">update_pc</a></code></li>
|
1156 |
|
|
</ul>
|
1157 |
|
|
</li>
|
1158 |
|
|
</ul>
|
1159 |
|
|
</nav>
|
1160 |
|
|
</main>
|
1161 |
|
|
<footer id="footer">
|
1162 |
|
|
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
|
1163 |
|
|
</footer>
|
1164 |
|
|
</body>
|
1165 |
|
|
</html>
|