-
Notifications
You must be signed in to change notification settings - Fork 14
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
DCS Modules #97
base: main
Are you sure you want to change the base?
DCS Modules #97
Conversation
recheck |
recheck |
1 similar comment
recheck |
Current status:
Most however is finished |
plugins/modules/dcs_instance_info.py
Outdated
# The API doesn't support queries, but we want to be able to not only list but also look for params of a specific instance | ||
# This part removes other instances from the data result so that only the one with the given params will be shown | ||
i = 0 | ||
while i < len(data): |
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.
not sure where it was, but same as I already wrote you: instead of putting everything and then removing from array process in the single loop:
for raw in __instances__:
if A and B and C:
data.append(raw)
That would be more clear and mostly more performant, since drop from list is an expensive operation
def run(self): | ||
data = [] | ||
|
||
# for raw in self.conn.dcs.backups(self.params['id']): |
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.
cool
recheck |
@SebastianGode can you please solve merge conflict? |
@gtema done |
recheck |
|
||
|
||
class DcsInstanceStatisticsInfoModule(OTCModule): | ||
argument_spec = dict( |
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.
even we can't do this from API pov, but I would really want to see support for name_or_id here. If not set - return everything, otherwise check name_or_id against item.name and item.id
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.
I wrote a way to filter it
@gtema I've updated the filter algorithm, should be faster now. |
No description provided.