-
Notifications
You must be signed in to change notification settings - Fork 8
agents, concepts: better changed api #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f4b0254
to
c8dd2de
Compare
d3554ca
to
136cdd1
Compare
136cdd1
to
2bc20a4
Compare
# find deleted pids | ||
missing_pids = [] | ||
for pid in pids: | ||
if cls.search().filter('term', pid=pid).count() == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably be optimized.
missing_pids.append(pid) | ||
for missing_pid in missing_pids: | ||
data = {'pid': missing_pid} | ||
mef = cls.get_record_by_pid( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get using id instead of pid for performance purpose.
'api_blueprint.agent_mef_get_updated', | ||
{'resolve': 1} | ||
) | ||
assert res.status_code == 200 | ||
pids = sorted([rec.get('pid') for rec in data]) | ||
assert pids == ['1', '2', '3'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems not robust.
res, data = postdata( | ||
client, | ||
'api_blueprint.agent_mef_get_updated', | ||
{"from_date": date.isoformat(), "pids": ['2', '4']} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems not robust. Do not use contant values if it is possible.
2bc20a4
to
61e200a
Compare
* Adds `resolve` to POST parameter. * Without `resolve` only `pid`, `_created`, `_updated` and `deleted`` will be returned. * Are unknown pids will be reported back without additional information. Example `{'pid', '42'} * dependencies updates * changes ci node to version 14 Co-Authored-by: Peter Weber <peter.weber@rero.ch>
61e200a
to
c1e83db
Compare
resolve
to POST parameter.resolve
onlypid
,_created
,_updated
and `deleted`` will be returned.Co-Authored-by: Peter Weber peter.weber@rero.ch