-
Notifications
You must be signed in to change notification settings - Fork 42
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
System Update API #2100
System Update API #2100
Changes from 1 commit
b7b60c0
9a5ae8c
468a263
1ce8ae6
9d86f52
24ab40c
cde4429
859605c
e3e3123
4eed1d7
afe32c1
186994e
ea4bbde
38e3444
dea5ada
a7d898c
54e1f45
34ebe77
4c59334
7aa207c
b9ac8b6
c143f8a
c6f9dff
78e3fb7
8ffa99a
1eeaf4e
c5b6264
ffea521
190af7c
fde6e98
3ef6f38
f8898a8
c145d60
2660a52
b3df99c
9ec0773
e992960
3dc2bb0
0746adf
5a2b99f
a28b371
0d22dd0
53d7d03
07dea02
05635bd
9575587
6cdfe40
b7a0b93
a1772af
f109cfe
File filter
Filter by extension
Conversations
Jump to
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ use omicron_common::api::external::{ | |
ObjectIdentity, RoleName, | ||
}; | ||
use schemars::JsonSchema; | ||
// use semver; | ||
use serde::{Deserialize, Serialize}; | ||
use std::net::IpAddr; | ||
use std::net::SocketAddrV6; | ||
|
@@ -412,3 +413,47 @@ pub struct DeviceAccessTokenGrant { | |
pub enum DeviceAccessTokenType { | ||
Bearer, | ||
} | ||
|
||
// SYSTEM UPDATES | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] | ||
pub struct SystemVersionRange { | ||
// TODO: if we want to use semver::Version, I think we have to newtype it | ||
// in order to implement JsonSchema. ew | ||
// pub low: semver::Version, | ||
// pub high: semver::Version, | ||
pub low: String, | ||
pub high: String, | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @smklein if we want to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe so - looks like someone already started work on this here: GREsau/schemars#195 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good timing. I looked but apparently in the wrong place. |
||
|
||
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum SystemVersionSteadyReason { | ||
Completed, | ||
Stopped, | ||
Failed, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum SystemVersionStatus { | ||
Updating { | ||
// target: semver::Version | ||
target: String, | ||
}, | ||
Steady { | ||
reason: SystemVersionSteadyReason, | ||
}, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] | ||
pub struct SystemUpdateStatus { | ||
pub version_range: SystemVersionRange, | ||
pub status: SystemVersionStatus, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] | ||
pub struct SystemUpdate { | ||
pub id: Uuid, | ||
pub version: String, | ||
} |
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.
Pretty sure this is already on your radar, but we should consider a non-stub call before merging