Skip to content

Conversation

SebastianGode
Copy link
Member

No description provided.

@SebastianGode
Copy link
Member Author

recheck

@SebastianGode
Copy link
Member Author

recheck

1 similar comment
@SebastianGode
Copy link
Member Author

recheck

otc-zuul[bot]
otc-zuul bot previously approved these changes Mar 10, 2021
@SebastianGode
Copy link
Member Author

Current status:

Most however is finished

# 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):
Copy link
Collaborator

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']):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

@SebastianGode SebastianGode marked this pull request as ready for review June 11, 2021 09:00
@SebastianGode
Copy link
Member Author

recheck

otc-zuul[bot]
otc-zuul bot previously approved these changes Jun 11, 2021
@gtema
Copy link
Collaborator

gtema commented Jun 23, 2021

@SebastianGode can you please solve merge conflict?

@SebastianGode
Copy link
Member Author

@gtema done

@SebastianGode
Copy link
Member Author

recheck

otc-zuul[bot]
otc-zuul bot previously approved these changes Jun 24, 2021


class DcsInstanceStatisticsInfoModule(OTCModule):
argument_spec = dict(
Copy link
Collaborator

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

Copy link
Member Author

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

otc-zuul[bot]
otc-zuul bot previously approved these changes Jun 28, 2021
otc-zuul[bot]
otc-zuul bot previously approved these changes Jun 28, 2021
otc-zuul[bot]
otc-zuul bot previously approved these changes Jul 1, 2021
@SebastianGode
Copy link
Member Author

@gtema I've updated the filter algorithm, should be faster now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants