Add more server actions
This adds most of the remaining server actions.
This includes all of the simple actions which have very single or no arguments taken and return nothing, as well as some which take relatively simple arguments (e.g. a few strings) but might return values.
The first question is, given the diversity of return values given by these actions, is it ok for us to provide that as a generic serde_json::Value, or should we define deserialisable structs for each action that provides a value? Perhaps the generic Server::action should return a serde_json::Value, but if we implement specific functions for any other actions in the future (like we already have for e.g. Server::stop) we define return type structs/types for those?
I did a quick survey and at the moment, there are only 6 actions which return anything and if we want could probably be encoded as:
CreateBackup->image_id: ImageRefCreateImage->image_id: ImageRefEvacuate->adminPass: Option<String>Rebuild->server: Server(orServerSummary?)Rescue->adminPass: Option<String>OsGetConsoleOutput->output: String
So probably in that situation, the wrapper functions would be simple enough.
Secondly, there are some more complex actions not implemented here. Is that ok that they will be added in some later version of rust-openstack? I assume so, given the #[non_exhaustive]. I expect that OpenStack will add more in the future too, so that covers that also.
The functional tests are filing on this. ~One of them, test_server_ops_with_port I think is the one that ephemerally failed on the last PR, here failing with Cannot create a key pair: Error { kind: Conflict, message: "Key pair 'rust-openstack-integration' already exists.", status: Some(409) }. The other two failures may well be due to the code changes in this PR. I will investigate.~ It's caused by the actions returning an empty body, which I had assumed would be parsed correctly by serde, but is not. I'll need to turn this into some valid serde::Value or return Option<serde::Value>.
The test test_server_ops_with_port is intermittently failing. Looking at the test, it's failing to find a floating IP just after a 1 second sleep. I'm guessing that the sleep was put in to give it time to assign the IP, but maybe sometimes it's not enough time. Maybe the sleep can be extended, or a retry added?
The test test_server_ops_with_port is intermittently failing. Looking at the test, it's failing to find a floating IP just after a 1 second sleep. I'm guessing that the sleep was put in to give it time to assign the IP, but maybe sometimes it's not enough time. Maybe the sleep can be extended, or a retry added?
Yeah, I've noticed it too. I suspect retrying for a longer time is the right way.
@milliams hi, are you still interested in this?
@milliams hi, are you still interested in this?
Yes, I'd like to get this in. I see that the floating IP timeout has been fixed in a recent PR, but I think I'll need #157 merged before the CI passes here.
@milliams yep, just merged it.