From 84cfca91d46c38f3370a3b6e947fd87f8846f8c9 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:50:17 -0700 Subject: [PATCH] Bump dependencies, progenitor to 4d364419, oxide.json to omicron:fd5f1f34 (#713) * Rebuilt with latest dependency updates * Rebuilt with latest dependency updates * Rebuilt with latest dependency updates --------- Co-authored-by: oxide-reflector-bot[bot] <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> --- Cargo.lock | 20 +- oxide.json | 82 +++++++- sdk/src/generated_sdk.rs | 415 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 505 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0651960b..eb858431 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1489,7 +1489,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2541,7 +2541,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.7.0" -source = "git+https://github.com/oxidecomputer/progenitor#65d8da55914b058015568fce22fdbcbba35ff0fb" +source = "git+https://github.com/oxidecomputer/progenitor#4d364419eda10f3bcd5e90228d55f3925a22b30c" dependencies = [ "progenitor-client 0.7.0 (git+https://github.com/oxidecomputer/progenitor)", "progenitor-impl", @@ -2566,7 +2566,7 @@ dependencies = [ [[package]] name = "progenitor-client" version = "0.7.0" -source = "git+https://github.com/oxidecomputer/progenitor#65d8da55914b058015568fce22fdbcbba35ff0fb" +source = "git+https://github.com/oxidecomputer/progenitor#4d364419eda10f3bcd5e90228d55f3925a22b30c" dependencies = [ "bytes", "futures-core", @@ -2580,7 +2580,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.7.0" -source = "git+https://github.com/oxidecomputer/progenitor#65d8da55914b058015568fce22fdbcbba35ff0fb" +source = "git+https://github.com/oxidecomputer/progenitor#4d364419eda10f3bcd5e90228d55f3925a22b30c" dependencies = [ "heck 0.5.0", "http 0.2.12", @@ -2601,7 +2601,7 @@ dependencies = [ [[package]] name = "progenitor-macro" version = "0.7.0" -source = "git+https://github.com/oxidecomputer/progenitor#65d8da55914b058015568fce22fdbcbba35ff0fb" +source = "git+https://github.com/oxidecomputer/progenitor#4d364419eda10f3bcd5e90228d55f3925a22b30c" dependencies = [ "openapiv3", "proc-macro2", @@ -3405,9 +3405,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.67" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -3839,7 +3839,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typify" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/typify#27406cedf5656e97fc6aa4c49e96e63a5b309178" +source = "git+https://github.com/oxidecomputer/typify#b462bde4209a1e75b59900dea213a840f216a6b7" dependencies = [ "typify-impl", "typify-macro", @@ -3848,7 +3848,7 @@ dependencies = [ [[package]] name = "typify-impl" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/typify#27406cedf5656e97fc6aa4c49e96e63a5b309178" +source = "git+https://github.com/oxidecomputer/typify#b462bde4209a1e75b59900dea213a840f216a6b7" dependencies = [ "heck 0.5.0", "log", @@ -3867,7 +3867,7 @@ dependencies = [ [[package]] name = "typify-macro" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/typify#27406cedf5656e97fc6aa4c49e96e63a5b309178" +source = "git+https://github.com/oxidecomputer/typify#b462bde4209a1e75b59900dea213a840f216a6b7" dependencies = [ "proc-macro2", "quote", diff --git a/oxide.json b/oxide.json index ab7192d1..a985a3e4 100644 --- a/oxide.json +++ b/oxide.json @@ -9344,6 +9344,39 @@ } ] }, + "AuthzScope": { + "description": "Authorization scope for a timeseries.\n\nThis describes the level at which a user must be authorized to read data from a timeseries. For example, fleet-scoping means the data is only visible to an operator or fleet reader. Project-scoped, on the other hand, indicates that a user will see data limited to the projects on which they have read permissions.", + "oneOf": [ + { + "description": "Timeseries data is limited to fleet readers.", + "type": "string", + "enum": [ + "fleet" + ] + }, + { + "description": "Timeseries data is limited to the authorized silo for a user.", + "type": "string", + "enum": [ + "silo" + ] + }, + { + "description": "Timeseries data is limited to the authorized projects for a user.", + "type": "string", + "enum": [ + "project" + ] + }, + { + "description": "The timeseries is viewable to all without limitation.", + "type": "string", + "enum": [ + "viewable_to_all" + ] + } + ] + }, "Baseboard": { "description": "Properties that uniquely identify an Oxide hardware component", "type": "object", @@ -12646,6 +12679,9 @@ "description": "The name and type information for a field of a timeseries schema.", "type": "object", "properties": { + "description": { + "type": "string" + }, "field_type": { "$ref": "#/components/schemas/FieldType" }, @@ -12657,6 +12693,7 @@ } }, "required": [ + "description", "field_type", "name", "source" @@ -16686,6 +16723,7 @@ "signing_keypair": { "nullable": true, "description": "request signing key pair", + "default": null, "allOf": [ { "$ref": "#/components/schemas/DerEncodedKeyPair" @@ -18546,6 +18584,22 @@ "points" ] }, + "TimeseriesDescription": { + "description": "Text descriptions for the target and metric of a timeseries.", + "type": "object", + "properties": { + "metric": { + "type": "string" + }, + "target": { + "type": "string" + } + }, + "required": [ + "metric", + "target" + ] + }, "TimeseriesName": { "title": "The name of a timeseries", "description": "Names are constructed by concatenating the target and metric names with ':'. Target and metric names must be lowercase alphanumeric characters with '_' separating words.", @@ -18569,6 +18623,9 @@ "description": "The schema for a timeseries.\n\nThis includes the name of the timeseries, as well as the datum type of its metric and the schema for each field.", "type": "object", "properties": { + "authz_scope": { + "$ref": "#/components/schemas/AuthzScope" + }, "created": { "type": "string", "format": "date-time" @@ -18576,6 +18633,9 @@ "datum_type": { "$ref": "#/components/schemas/DatumType" }, + "description": { + "$ref": "#/components/schemas/TimeseriesDescription" + }, "field_schema": { "type": "array", "items": { @@ -18585,13 +18645,25 @@ }, "timeseries_name": { "$ref": "#/components/schemas/TimeseriesName" + }, + "units": { + "$ref": "#/components/schemas/Units" + }, + "version": { + "type": "integer", + "format": "uint8", + "minimum": 1 } }, "required": [ + "authz_scope", "created", "datum_type", + "description", "field_schema", - "timeseries_name" + "timeseries_name", + "units", + "version" ] }, "TimeseriesSchemaResultsPage": { @@ -18675,6 +18747,14 @@ "items" ] }, + "Units": { + "description": "Measurement units for timeseries samples.", + "type": "string", + "enum": [ + "count", + "bytes" + ] + }, "User": { "description": "View of a User", "type": "object", diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 1b935a83..880f6f01 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -880,6 +880,139 @@ pub mod types { } } + /// Authorization scope for a timeseries. + /// + /// This describes the level at which a user must be authorized to read data + /// from a timeseries. For example, fleet-scoping means the data is only + /// visible to an operator or fleet reader. Project-scoped, on the other + /// hand, indicates that a user will see data limited to the projects on + /// which they have read permissions. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Authorization scope for a timeseries.\n\nThis describes + /// the level at which a user must be authorized to read data from a + /// timeseries. For example, fleet-scoping means the data is only visible to + /// an operator or fleet reader. Project-scoped, on the other hand, + /// indicates that a user will see data limited to the projects on which + /// they have read permissions.", + /// "oneOf": [ + /// { + /// "description": "Timeseries data is limited to fleet readers.", + /// "type": "string", + /// "enum": [ + /// "fleet" + /// ] + /// }, + /// { + /// "description": "Timeseries data is limited to the authorized silo + /// for a user.", + /// "type": "string", + /// "enum": [ + /// "silo" + /// ] + /// }, + /// { + /// "description": "Timeseries data is limited to the authorized + /// projects for a user.", + /// "type": "string", + /// "enum": [ + /// "project" + /// ] + /// }, + /// { + /// "description": "The timeseries is viewable to all without + /// limitation.", + /// "type": "string", + /// "enum": [ + /// "viewable_to_all" + /// ] + /// } + /// ] + /// } + /// ``` + ///
+ #[derive( + Clone, + Copy, + Debug, + Deserialize, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + schemars :: JsonSchema, + )] + pub enum AuthzScope { + /// Timeseries data is limited to fleet readers. + #[serde(rename = "fleet")] + Fleet, + /// Timeseries data is limited to the authorized silo for a user. + #[serde(rename = "silo")] + Silo, + /// Timeseries data is limited to the authorized projects for a user. + #[serde(rename = "project")] + Project, + /// The timeseries is viewable to all without limitation. + #[serde(rename = "viewable_to_all")] + ViewableToAll, + } + + impl From<&AuthzScope> for AuthzScope { + fn from(value: &AuthzScope) -> Self { + value.clone() + } + } + + impl ToString for AuthzScope { + fn to_string(&self) -> String { + match *self { + Self::Fleet => "fleet".to_string(), + Self::Silo => "silo".to_string(), + Self::Project => "project".to_string(), + Self::ViewableToAll => "viewable_to_all".to_string(), + } + } + } + + impl std::str::FromStr for AuthzScope { + type Err = self::error::ConversionError; + fn from_str(value: &str) -> Result { + match value { + "fleet" => Ok(Self::Fleet), + "silo" => Ok(Self::Silo), + "project" => Ok(Self::Project), + "viewable_to_all" => Ok(Self::ViewableToAll), + _ => Err("invalid value".into()), + } + } + } + + impl std::convert::TryFrom<&str> for AuthzScope { + type Error = self::error::ConversionError; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for AuthzScope { + type Error = self::error::ConversionError; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for AuthzScope { + type Error = self::error::ConversionError; + fn try_from(value: String) -> Result { + value.parse() + } + } + /// Properties that uniquely identify an Oxide hardware component /// ///
JSON schema @@ -7204,11 +7337,15 @@ pub mod types { /// timeseries schema.", /// "type": "object", /// "required": [ + /// "description", /// "field_type", /// "name", /// "source" /// ], /// "properties": { + /// "description": { + /// "type": "string" + /// }, /// "field_type": { /// "$ref": "#/components/schemas/FieldType" /// }, @@ -7224,6 +7361,7 @@ pub mod types { ///
#[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] pub struct FieldSchema { + pub description: String, pub field_type: FieldType, pub name: String, pub source: FieldSource, @@ -21877,6 +22015,48 @@ pub mod types { } } + /// Text descriptions for the target and metric of a timeseries. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Text descriptions for the target and metric of a + /// timeseries.", + /// "type": "object", + /// "required": [ + /// "metric", + /// "target" + /// ], + /// "properties": { + /// "metric": { + /// "type": "string" + /// }, + /// "target": { + /// "type": "string" + /// } + /// } + /// } + /// ``` + ///
+ #[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] + pub struct TimeseriesDescription { + pub metric: String, + pub target: String, + } + + impl From<&TimeseriesDescription> for TimeseriesDescription { + fn from(value: &TimeseriesDescription) -> Self { + value.clone() + } + } + + impl TimeseriesDescription { + pub fn builder() -> builder::TimeseriesDescription { + Default::default() + } + } + /// Names are constructed by concatenating the target and metric names with /// ':'. Target and metric names must be lowercase alphanumeric characters /// with '_' separating words. @@ -22026,12 +22206,19 @@ pub mod types { /// schema for each field.", /// "type": "object", /// "required": [ + /// "authz_scope", /// "created", /// "datum_type", + /// "description", /// "field_schema", - /// "timeseries_name" + /// "timeseries_name", + /// "units", + /// "version" /// ], /// "properties": { + /// "authz_scope": { + /// "$ref": "#/components/schemas/AuthzScope" + /// }, /// "created": { /// "type": "string", /// "format": "date-time" @@ -22039,6 +22226,9 @@ pub mod types { /// "datum_type": { /// "$ref": "#/components/schemas/DatumType" /// }, + /// "description": { + /// "$ref": "#/components/schemas/TimeseriesDescription" + /// }, /// "field_schema": { /// "type": "array", /// "items": { @@ -22048,6 +22238,14 @@ pub mod types { /// }, /// "timeseries_name": { /// "$ref": "#/components/schemas/TimeseriesName" + /// }, + /// "units": { + /// "$ref": "#/components/schemas/Units" + /// }, + /// "version": { + /// "type": "integer", + /// "format": "uint8", + /// "minimum": 1.0 /// } /// } /// } @@ -22055,10 +22253,14 @@ pub mod types { /// #[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] pub struct TimeseriesSchema { + pub authz_scope: AuthzScope, pub created: chrono::DateTime, pub datum_type: DatumType, + pub description: TimeseriesDescription, pub field_schema: Vec, pub timeseries_name: TimeseriesName, + pub units: Units, + pub version: std::num::NonZeroU8, } impl From<&TimeseriesSchema> for TimeseriesSchema { @@ -22268,6 +22470,88 @@ pub mod types { } } + /// Measurement units for timeseries samples. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Measurement units for timeseries samples.", + /// "type": "string", + /// "enum": [ + /// "count", + /// "bytes" + /// ] + /// } + /// ``` + ///
+ #[derive( + Clone, + Copy, + Debug, + Deserialize, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + schemars :: JsonSchema, + )] + pub enum Units { + #[serde(rename = "count")] + Count, + #[serde(rename = "bytes")] + Bytes, + } + + impl From<&Units> for Units { + fn from(value: &Units) -> Self { + value.clone() + } + } + + impl ToString for Units { + fn to_string(&self) -> String { + match *self { + Self::Count => "count".to_string(), + Self::Bytes => "bytes".to_string(), + } + } + } + + impl std::str::FromStr for Units { + type Err = self::error::ConversionError; + fn from_str(value: &str) -> Result { + match value { + "count" => Ok(Self::Count), + "bytes" => Ok(Self::Bytes), + _ => Err("invalid value".into()), + } + } + } + + impl std::convert::TryFrom<&str> for Units { + type Error = self::error::ConversionError; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for Units { + type Error = self::error::ConversionError; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for Units { + type Error = self::error::ConversionError; + fn try_from(value: String) -> Result { + value.parse() + } + } + /// View of a User /// ///
JSON schema @@ -29393,6 +29677,7 @@ pub mod types { #[derive(Clone, Debug)] pub struct FieldSchema { + description: Result, field_type: Result, name: Result, source: Result, @@ -29401,6 +29686,7 @@ pub mod types { impl Default for FieldSchema { fn default() -> Self { Self { + description: Err("no value supplied for description".to_string()), field_type: Err("no value supplied for field_type".to_string()), name: Err("no value supplied for name".to_string()), source: Err("no value supplied for source".to_string()), @@ -29409,6 +29695,16 @@ pub mod types { } impl FieldSchema { + pub fn description(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.description = value + .try_into() + .map_err(|e| format!("error converting supplied value for description: {}", e)); + self + } pub fn field_type(mut self, value: T) -> Self where T: std::convert::TryInto, @@ -29445,6 +29741,7 @@ pub mod types { type Error = super::error::ConversionError; fn try_from(value: FieldSchema) -> Result { Ok(Self { + description: value.description?, field_type: value.field_type?, name: value.name?, source: value.source?, @@ -29455,6 +29752,7 @@ pub mod types { impl From for FieldSchema { fn from(value: super::FieldSchema) -> Self { Self { + description: Ok(value.description), field_type: Ok(value.field_type), name: Ok(value.name), source: Ok(value.source), @@ -41162,6 +41460,65 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct TimeseriesDescription { + metric: Result, + target: Result, + } + + impl Default for TimeseriesDescription { + fn default() -> Self { + Self { + metric: Err("no value supplied for metric".to_string()), + target: Err("no value supplied for target".to_string()), + } + } + } + + impl TimeseriesDescription { + pub fn metric(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.metric = value + .try_into() + .map_err(|e| format!("error converting supplied value for metric: {}", e)); + self + } + pub fn target(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.target = value + .try_into() + .map_err(|e| format!("error converting supplied value for target: {}", e)); + self + } + } + + impl std::convert::TryFrom for super::TimeseriesDescription { + type Error = super::error::ConversionError; + fn try_from( + value: TimeseriesDescription, + ) -> Result { + Ok(Self { + metric: value.metric?, + target: value.target?, + }) + } + } + + impl From for TimeseriesDescription { + fn from(value: super::TimeseriesDescription) -> Self { + Self { + metric: Ok(value.metric), + target: Ok(value.target), + } + } + } + #[derive(Clone, Debug)] pub struct TimeseriesQuery { query: Result, @@ -41207,24 +41564,42 @@ pub mod types { #[derive(Clone, Debug)] pub struct TimeseriesSchema { + authz_scope: Result, created: Result, String>, datum_type: Result, + description: Result, field_schema: Result, String>, timeseries_name: Result, + units: Result, + version: Result, } impl Default for TimeseriesSchema { fn default() -> Self { Self { + authz_scope: Err("no value supplied for authz_scope".to_string()), created: Err("no value supplied for created".to_string()), datum_type: Err("no value supplied for datum_type".to_string()), + description: Err("no value supplied for description".to_string()), field_schema: Err("no value supplied for field_schema".to_string()), timeseries_name: Err("no value supplied for timeseries_name".to_string()), + units: Err("no value supplied for units".to_string()), + version: Err("no value supplied for version".to_string()), } } } impl TimeseriesSchema { + pub fn authz_scope(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.authz_scope = value + .try_into() + .map_err(|e| format!("error converting supplied value for authz_scope: {}", e)); + self + } pub fn created(mut self, value: T) -> Self where T: std::convert::TryInto>, @@ -41245,6 +41620,16 @@ pub mod types { .map_err(|e| format!("error converting supplied value for datum_type: {}", e)); self } + pub fn description(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.description = value + .try_into() + .map_err(|e| format!("error converting supplied value for description: {}", e)); + self + } pub fn field_schema(mut self, value: T) -> Self where T: std::convert::TryInto>, @@ -41265,16 +41650,40 @@ pub mod types { }); self } + pub fn units(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.units = value + .try_into() + .map_err(|e| format!("error converting supplied value for units: {}", e)); + self + } + pub fn version(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.version = value + .try_into() + .map_err(|e| format!("error converting supplied value for version: {}", e)); + self + } } impl std::convert::TryFrom for super::TimeseriesSchema { type Error = super::error::ConversionError; fn try_from(value: TimeseriesSchema) -> Result { Ok(Self { + authz_scope: value.authz_scope?, created: value.created?, datum_type: value.datum_type?, + description: value.description?, field_schema: value.field_schema?, timeseries_name: value.timeseries_name?, + units: value.units?, + version: value.version?, }) } } @@ -41282,10 +41691,14 @@ pub mod types { impl From for TimeseriesSchema { fn from(value: super::TimeseriesSchema) -> Self { Self { + authz_scope: Ok(value.authz_scope), created: Ok(value.created), datum_type: Ok(value.datum_type), + description: Ok(value.description), field_schema: Ok(value.field_schema), timeseries_name: Ok(value.timeseries_name), + units: Ok(value.units), + version: Ok(value.version), } } }