oxidecomputer / oxide.rs

The Oxide Rust SDK and CLI
Mozilla Public License 2.0
37 stars 12 forks source link

Commands for common network operations #726

Closed rcgoodfellow closed 1 month ago

rcgoodfellow commented 2 months ago

We have a transactional API for port settings objects. The port settings object is somewhat complex. The port settings object returned by GET requests to view port settings is not exactly the same as the port settings object used to create/update port settings with PUT/POST requests. This makes it rather grueling to manage port settings.

This PR adds client-side read/modify/write routines for managing individual items within port settings such as addresses.

Also pulls in the observability stuff from #661.

An example of using these new commands is here, which demonstrates creating a new BGP connection to a cloud provider. An example of using the observability stuff pulled in from #661 is in this comment analyzing an Omicron bug.

rcgoodfellow commented 2 months ago

Now depends on

rcgoodfellow commented 1 month ago

For testing, I've added an expectorate test for the one command that produces stable output: oxide system networking switch-port-settings show. The other commands are either strictly modifiers and don't return any output or are hooked up to an API endpoint that is not stable yet and returns an Object, making strongly typed testing a bit of a challenge and perhaps not worthwhile until the interface stabilizes in the API.