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

Add virtual machine manager #69

Closed

Conversation

realtek2017
Copy link

Functionality extended to support Virtual Machine Manager API.

New methods include:

List all Virtual Guest Names
List Virtual Guest Statuses
Power on a Guest
Power off a Guest
Shutdown a Guest

@realtek2017 realtek2017 requested a review from mib1185 as a code owner November 10, 2021 11:18
from synology_dsm.helpers import SynoFormatHelper


class SynoVirtualMachineManager:
Copy link
Owner

Choose a reason for hiding this comment

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

this class should be moved to __init__.py

"""Updates Virtual Machine Guest data."""
raw_data = self._dsm.get(self.API_KEY, "list")
if raw_data:
self._data = raw_data["data"]
Copy link
Owner

Choose a reason for hiding this comment

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

you should create an own class for the guest object (suggest SynoVmmGuest) which holds all the data and exposes properties (compare with surveillance_station)

@mib1185
Copy link
Owner

mib1185 commented Nov 11, 2021

Hi @realtek2017
I like this idea, so let's work on it to bring it on the road 😉

Overall please compare with the implementation of surveillance_station - it implements the generic class SynoSurveillanceStation which more or less represents the app itself and the class SynoCamera which represents the single camera instance with its properties like the name, id, model,...
Last but not least ... tests are also needed 😉

Btw I'm missing the reboot method 😉

@realtek2017
Copy link
Author

realtek2017 commented Nov 12, 2021

Hi @realtek2017 I like this idea, so let's work on it to bring it on the road wink

Overall please compare with the implementation of surveillance_station - it implements the generic class SynoSurveillanceStation which more or less represents the app itself and the class SynoCamera which represents the single camera instance with its properties like the name, id, model,... Last but not least ... tests are also needed wink

Btw I'm missing the reboot method wink

Thanks @mib1185 for all your comments, I appreciate your feedback.

My reason for adding this was driven from being able to use this eventually on the homeassistant integration :)

I will make the changes as requested, had some issues with getting poetry working so I will try and fix that for the tests.

Well spotted on the reboot method - that would be helpful :)

@mib1185
Copy link
Owner

mib1185 commented Nov 12, 2021

My reason for adding this was driven from being able to use this eventually on the homeassistant integration :)

was hoping, that this is the reason behind 🤞

I will make the changes as requested, had some issues with getting poetry working so I will try and fix that for the tests.

If you are using VSCode and have Docker installed on your system, you can use the devcontainer in this project 😉

@mib1185 mib1185 added this to the 1.1.0 milestone Feb 9, 2022
@mib1185 mib1185 added the enhancement PR that adds new feature label Sep 19, 2022
@mib1185 mib1185 modified the milestones: 1.1.0, 2.1.0 Jan 15, 2023
@mib1185 mib1185 modified the milestones: 2.1.0, 2.2.0 Jan 29, 2023
@mib1185 mib1185 modified the milestones: 2.2.0, 2.3.0 Mar 18, 2023
@mib1185 mib1185 modified the milestones: 2.3.0, 2.6.0 Oct 4, 2024
@mib1185
Copy link
Owner

mib1185 commented Oct 4, 2024

This will be implemented with #363

@mib1185 mib1185 closed this Oct 4, 2024
@mib1185 mib1185 removed this from the 2.6.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PR that adds new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants