-
Notifications
You must be signed in to change notification settings - Fork 63
[bootstrap-agent] Expose HTTP server for component version querying #2466
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4f9ff68
[omicron-package] Add ability to stamp component versions onto Omicro…
smklein c3275df
Merge branch 'main' into version-stamp-pkg
smklein aa5f5eb
use local paths for dev
smklein 933673f
Merge branch 'main' into version-stamp-pkg
smklein ff18fe7
Expose version API from bootstrap server
smklein 4469006
Merge branch 'main' into version-stamp-pkg
smklein 931dee4
Merge branch 'version-stamp-pkg' into expose-version-info
smklein a075bc5
[bootstrap-agent] Expose HTTP server to advertise component version i…
smklein d75522b
Merge branch 'main' into version-stamp-pkg
smklein 0413ea7
Merge branch 'main' into version-stamp-pkg
smklein fc5c3d6
Merge branch 'version-stamp-pkg' into expose-version-info
smklein bc4f9db
cargo
smklein a198a10
new pkg merge
smklein 5459bd1
Merge branch 'main' into version-stamp-pkg
smklein 1a4a457
Merge branch 'version-stamp-pkg' into expose-version-info
smklein 1d2cf8b
0.8.3 of omicron-zone-package
smklein 49990d7
Merge branch 'version-stamp-pkg' into expose-version-info
smklein 687274f
endpoint docs
smklein fe828dd
Add tests
smklein d8fa78c
Updated error message
smklein ee40038
Merge branch 'version-stamp-pkg' into expose-version-info
smklein ad1a629
Merge branch 'main' into version-stamp-pkg
smklein 7876a53
Merge branch 'version-stamp-pkg' into expose-version-info
smklein 4d9df26
Merge branch 'main' into expose-version-info
smklein 0afa11c
typo
smklein 313f2f4
Merge branch 'main' into expose-version-info
smklein eb7279c
get rid of bootstrap_address
smklein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // This Source Code Form is subject to the terms of the Mozilla Public | ||
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| //! HTTP entrypoint functions for the bootstrap agent's API. | ||
| //! | ||
| //! Note that the bootstrap agent also communicates over Sprockets, | ||
| //! and has a separate interface for establishing the trust quorum. | ||
|
|
||
| use crate::bootstrap::agent::Agent; | ||
| use crate::updates::Component; | ||
| use dropshot::{ | ||
| endpoint, ApiDescription, HttpError, HttpResponseOk, RequestContext, | ||
| }; | ||
| use omicron_common::api::external::Error; | ||
| use std::sync::Arc; | ||
|
|
||
| type BootstrapApiDescription = ApiDescription<Arc<Agent>>; | ||
|
|
||
| /// Returns a description of the bootstrap agent API | ||
| pub(crate) fn api() -> BootstrapApiDescription { | ||
| fn register_endpoints( | ||
| api: &mut BootstrapApiDescription, | ||
| ) -> Result<(), String> { | ||
| api.register(components_get)?; | ||
| Ok(()) | ||
| } | ||
|
|
||
| let mut api = BootstrapApiDescription::new(); | ||
| if let Err(err) = register_endpoints(&mut api) { | ||
| panic!("failed to register entrypoints: {}", err); | ||
| } | ||
| api | ||
| } | ||
|
|
||
| /// Provides a list of components known to the bootstrap agent. | ||
| /// | ||
| /// This API is intended to allow early boot services (such as Wicket) | ||
| /// to query the underlying component versions installed on a sled. | ||
| #[endpoint { | ||
| method = GET, | ||
| path = "/components", | ||
| }] | ||
| async fn components_get( | ||
| rqctx: RequestContext<Arc<Agent>>, | ||
| ) -> Result<HttpResponseOk<Vec<Component>>, HttpError> { | ||
| let ba = rqctx.context(); | ||
| let components = ba.components_get().await.map_err(|e| Error::from(e))?; | ||
| Ok(HttpResponseOk(components)) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.