-
Notifications
You must be signed in to change notification settings - Fork 40
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
[nexus] Support Bundle HTTP endpoint implementations #7187
base: support-bundle-bg-task
Are you sure you want to change the base?
[nexus] Support Bundle HTTP endpoint implementations #7187
Conversation
let mut builder = Response::builder().status(response.status()); | ||
let headers = builder.headers_mut().unwrap(); | ||
headers.extend( | ||
response.headers().iter().map(|(k, v)| (k.clone(), v.clone())), | ||
); | ||
let body = http_body_util::StreamBody::new( | ||
response | ||
.into_inner_stream() | ||
.map_ok(|b| hyper::body::Frame::data(b)), | ||
); | ||
Ok(builder.body(Body::wrap(body)).unwrap()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intent here is to act as much like a transparent proxy as I can -- find the sled that should hold the bundle, and send a request there.
If it's possible to do that without these types, I'd love that.
.await?; | ||
let client = self.sled_client(&sled_id).await?; | ||
|
||
// TODO: Use "range"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to do this with the progenitor-generated API.
I could pull out the reqwest client manually, with client.client()
(names are silly) , and then I could manually construct the URL / body / headers, but... that kinda defeats the point of using progenitor, right?
That might be our only option for the moment.
07be0de
to
9b2176c
Compare
SetupReq::Post { | ||
url: &SUPPORT_BUNDLES_URL, | ||
body: serde_json::to_value(()).unwrap(), | ||
id_routes: vec!["/experimental/v1/system/support-bundles/{id}"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: If I want to get coverage for the download/index paths, I need them here as id_routes
too.
support_bundle_download (get "/experimental/v1/system/support-bundles/{support_bundle}/download") | ||
support_bundle_download_file (get "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}") | ||
support_bundle_index (get "/experimental/v1/system/support-bundles/{support_bundle}/index") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably possible to test these endpoints in the unathorized.rs test, but it's kinda a pain -- one of the "setup requests" there involves POST-ing the support bundle, but it doesn't wait for the background task of collection to complete asynchronously.
PR 5 / ???
Implements support bundle APIs for accessing storage bundles.
Builds atop the API skeleton in:
Uses the support bundle datastore interfaces in:
Relies on the background task in:
TODO before merging: