Skip to content
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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

DCS Modules #97

wants to merge 31 commits into from

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

plugins/modules/dcs_instance_backup.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_backup.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_backup.py Show resolved Hide resolved
# 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
Member

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
Member

Choose a reason for hiding this comment

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

cool

plugins/modules/dcs_instance_password.py Show resolved Hide resolved
plugins/modules/dcs_instance_password.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_password.py Outdated Show resolved Hide resolved
@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
Member

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
plugins/modules/dcs_instance_backup.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_backup.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_info.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_info.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_maintain_info.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_params_info.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_params_info.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_password.py Outdated Show resolved Hide resolved
plugins/modules/dcs_instance_restore_info.py Outdated Show resolved Hide resolved


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

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