joyent / conch-api

Datacenter build and management service
Mozilla Public License 2.0
22 stars 11 forks source link

Want ability to remove relays #868

Closed daleghent closed 5 years ago

daleghent commented 5 years ago

The relay list (see: conch rs get) is getting rather long, and a non-trivial portion of that list is populated by relays that do not exist anymore or will never be used again (such as the original Raspberry Pi-based ones.)

A method to clean the list of relays up by removing specific ones would be very helpful.

daleghent commented 5 years ago

Just noting another good reason for this - it is likely that we will no longer do preflight outside of datacenters in the future. This means means the DRDs will likely no longer be used, and their removal from the relay list would be very desirable should this policy be confirmed.

karenetheridge commented 5 years ago

Sure, I can add a DELETE /relay/:id endpoint. I am presuming that the underlying database operations would be:

sungo commented 5 years ago

I'd probably just set the deactivated property. It's a much smaller lift and I don't think we'll have problems with the continued existence of those join rows.

karenetheridge commented 5 years ago

It's a much smaller lift

No, it's trivial to delete these entries, and it would be consistent with all other database operations that remove join rows when we update a deactivated property.

daleghent commented 5 years ago

I didn't realize that this ticket would extend to actually deleting relays from the db; I just wanted the functionality available to do that so that I can determine which ones should be deleted and do so.

sungo commented 5 years ago

@daleghent We're mostly debating whether your action of deleting a relay should just set a property in the database or also delete the data that connects a relay to its users and devices.

karenetheridge commented 5 years ago

I didn't realize that this ticket would extend to actually deleting relays from the db

My proposal would mean that we don't delete relays from the db. Most other delete operations* in the api involve setting a 'deactivated' timestamp in the database, which is then checked for in all other database operations so that row is omitted.

* such tables are:

daleghent commented 5 years ago

Ah ok. I'm just jittery about obliterating any record of a given relay since the relay list serves as cross-check for the PRD/DRD devices that are out there. I reckon that we will eventually want to recall these from the various places they currently reside in, and I plan to use the relay list to help verify that we've recovered all of them.