Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-dfs
csst-dfs-api-cluster
Commits
e0d7eb60
Commit
e0d7eb60
authored
Jul 13, 2023
by
Wei Shoulin
Browse files
find by ids
parent
03cba449
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api_cluster/facility/level1.py
View file @
e0d7eb60
...
@@ -85,6 +85,27 @@ class Level1DataApi(object):
...
@@ -85,6 +85,27 @@ class Level1DataApi(object):
except
grpc
.
RpcError
as
e
:
except
grpc
.
RpcError
as
e
:
return
Result
.
error
(
message
=
"%s:%s"
%
(
e
.
code
().
value
,
e
.
details
()))
return
Result
.
error
(
message
=
"%s:%s"
%
(
e
.
code
().
value
,
e
.
details
()))
def
find_by_ids
(
self
,
**
kwargs
):
''' retrieve level1 records by internal level1 ids like [1,2,3,4]
:param kwargs: Parameter dictionary, key items support:
brick_ids: [list]
return: csst_dfs_common.models.Result
'''
try
:
resp
,
_
=
self
.
stub
.
FindByIds
.
with_call
(
level1_pb2
.
FindByIdsReq
(
ids
=
get_parameter
(
kwargs
,
"ids"
,
[])
),
metadata
=
get_auth_headers
())
if
resp
.
success
:
return
Result
.
ok_data
(
data
=
from_proto_model_list
(
Level1Record
,
resp
.
records
))
else
:
return
Result
.
error
(
message
=
str
(
resp
.
error
.
detail
))
except
grpc
.
RpcError
as
e
:
return
Result
.
error
(
message
=
"%s:%s"
%
(
e
.
code
().
value
,
e
.
details
()))
def
sls_find_by_qc1_status
(
self
,
**
kwargs
):
def
sls_find_by_qc1_status
(
self
,
**
kwargs
):
''' retrieve level1 records from database
''' retrieve level1 records from database
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment