The-Nazara-Project / Nazara

A CLI application to create and update machines and VMs in Netbox.
GNU General Public License v3.0
11 stars 2 forks source link

Implement machine get request and search #51

Closed ByteOtter closed 8 months ago

ByteOtter commented 9 months ago

What does this PR change?

This PR will adjust Nazara's usage based on the new workflow we agreed upon.

Given that Thanix now takes care of our API client implementation we might need to change the following:

Stage 1 Goals:

Stage 2 Goals:

Tick the applicable box:

Links

Fixes: #54, #61

Tracks: #60

Documentation

ByteOtter commented 8 months ago

@SchoolGuy I think I have fixed our problem for now regarding the search key problem. If you remember, we had the problem that we did not know which key to search the current machine for in the list of machines registered. For now, by default, we always search for serial numbers. However, I am aware that, especially for weird prototypes and stuff this might not work out. So Nazara's behaviour will enforce that you give your machines unique names and pass the name to Nazara. If we have a name, we use that a primary search parameter.

Yes this moves the problem to the user but otherwise this is a problem without a solution as UUIDs and not by default part of a device and also very unreliable.

Also, if the user decides to hand over names we can assume that they are aware of their use case.

SchoolGuy commented 8 months ago

@ByteOtter I think for this PR this is a more than suitable strategy. Once we have established that it works we can in the future improve it if needed. Please continue in the direction that you are currently working to. It looks very good!

ByteOtter commented 8 months ago

@SchoolGuy as you correctly stated today, this PR is getting kind of long. I fell now that I have reached a good point where I can merge this under the title "Implement machine get request and search". The open TODOs in this PR will be converted to issues. To this end, the next commit will contain a bunch of cleanups. Afterwards, if the CI is green, I will go ahead with a merge.