Skip to content

Commit

Permalink
Bump dependencies, progenitor to 69158f7d, oxide.json to omicron:c9ad…
Browse files Browse the repository at this point in the history
…e9dc (#916)
  • Loading branch information
oxide-reflector-bot[bot] authored Nov 22, 2024
1 parent bb54178 commit 3e478c9
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 21 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions cli/docs/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,14 @@
"long": "json-body-template",
"help": "XXX"
},
{
"long": "memory",
"help": "The amount of memory to assign to this instance.; unit suffixes are in powers of two (1k = 1024 bytes) for example: 6GiB, 512k, 2048mib"
},
{
"long": "ncpus",
"help": "The number of CPUs to assign to this instance."
},
{
"long": "profile",
"help": "Configuration profile to use for commands",
Expand Down
22 changes: 22 additions & 0 deletions cli/src/generated_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,20 @@ impl<T: CliConfig> Cli<T> {
.required(true)
.help("Name or ID of the instance"),
)
.arg(
clap::Arg::new("memory")
.long("memory")
.value_parser(clap::value_parser!(types::ByteCount))
.required_unless_present("json-body")
.help("The amount of memory to assign to this instance."),
)
.arg(
clap::Arg::new("ncpus")
.long("ncpus")
.value_parser(clap::value_parser!(types::InstanceCpuCount))
.required_unless_present("json-body")
.help("The number of CPUs to assign to this instance."),
)
.arg(
clap::Arg::new("project")
.long("project")
Expand Down Expand Up @@ -8253,6 +8267,14 @@ impl<T: CliConfig> Cli<T> {
request = request.instance(value.clone());
}

if let Some(value) = matches.get_one::<types::ByteCount>("memory") {
request = request.body_map(|body| body.memory(value.clone()))
}

if let Some(value) = matches.get_one::<types::InstanceCpuCount>("ncpus") {
request = request.body_map(|body| body.ncpus(value.clone()))
}

if let Some(value) = matches.get_one::<types::NameOrId>("project") {
request = request.project(value.clone());
}
Expand Down
28 changes: 24 additions & 4 deletions oxide.json
Original file line number Diff line number Diff line change
Expand Up @@ -13217,7 +13217,7 @@
"type": "object",
"properties": {
"private_key": {
"description": "request signing private key (base64 encoded der file)",
"description": "request signing RSA private key in PKCS#1 format (base64 encoded der file)",
"type": "string"
},
"public_cert": {
Expand Down Expand Up @@ -16491,8 +16491,28 @@
"$ref": "#/components/schemas/NameOrId"
}
]
},
"memory": {
"description": "The amount of memory to assign to this instance.",
"allOf": [
{
"$ref": "#/components/schemas/ByteCount"
}
]
},
"ncpus": {
"description": "The number of CPUs to assign to this instance.",
"allOf": [
{
"$ref": "#/components/schemas/InstanceCpuCount"
}
]
}
}
},
"required": [
"memory",
"ncpus"
]
},
"InternetGateway": {
"description": "An internet gateway provides a path between VPC networks and external networks.",
Expand Down Expand Up @@ -17167,7 +17187,7 @@
},
"fec": {
"nullable": true,
"description": "The forward error correction mode of the link.",
"description": "The requested forward-error correction method. If this is not specified, the standard FEC for the underlying media will be applied if it can be determined.",
"allOf": [
{
"$ref": "#/components/schemas/LinkFec"
Expand Down Expand Up @@ -20411,7 +20431,7 @@
},
"fec": {
"nullable": true,
"description": "The forward error correction mode of the link.",
"description": "The requested forward-error correction method. If this is not specified, the standard FEC for the underlying media will be applied if it can be determined.",
"allOf": [
{
"$ref": "#/components/schemas/LinkFec"
Expand Down
75 changes: 68 additions & 7 deletions sdk/src/generated_sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5946,8 +5946,8 @@ pub mod types {
/// ],
/// "properties": {
/// "private_key": {
/// "description": "request signing private key (base64 encoded der
/// file)",
/// "description": "request signing RSA private key in PKCS#1 format
/// (base64 encoded der file)",
/// "type": "string"
/// },
/// "public_cert": {
Expand All @@ -5963,7 +5963,8 @@ pub mod types {
:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema,
)]
pub struct DerEncodedKeyPair {
/// request signing private key (base64 encoded der file)
/// request signing RSA private key in PKCS#1 format (base64 encoded der
/// file)
pub private_key: String,
/// request signing public certificate (base64 encoded der file)
pub public_cert: String,
Expand Down Expand Up @@ -13021,6 +13022,10 @@ pub mod types {
/// "description": "Parameters of an `Instance` that can be reconfigured
/// after creation.",
/// "type": "object",
/// "required": [
/// "memory",
/// "ncpus"
/// ],
/// "properties": {
/// "auto_restart_policy": {
/// "description": "Sets the auto-restart policy for this
Expand Down Expand Up @@ -13063,6 +13068,22 @@ pub mod types {
/// ]
/// }
/// ]
/// },
/// "memory": {
/// "description": "The amount of memory to assign to this instance.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ByteCount"
/// }
/// ]
/// },
/// "ncpus": {
/// "description": "The number of CPUs to assign to this instance.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/InstanceCpuCount"
/// }
/// ]
/// }
/// }
/// }
Expand Down Expand Up @@ -13094,6 +13115,10 @@ pub mod types {
/// If not provided, unset the instance's boot disk.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub boot_disk: Option<NameOrId>,
/// The amount of memory to assign to this instance.
pub memory: ByteCount,
/// The number of CPUs to assign to this instance.
pub ncpus: InstanceCpuCount,
}

impl From<&InstanceUpdate> for InstanceUpdate {
Expand Down Expand Up @@ -15020,7 +15045,9 @@ pub mod types {
/// "type": "boolean"
/// },
/// "fec": {
/// "description": "The forward error correction mode of the link.",
/// "description": "The requested forward-error correction method. If
/// this is not specified, the standard FEC for the underlying media will be
/// applied if it can be determined.",
/// "oneOf": [
/// {
/// "type": "null"
Expand Down Expand Up @@ -15082,7 +15109,9 @@ pub mod types {
pub struct LinkConfigCreate {
/// Whether or not to set autonegotiation
pub autoneg: bool,
/// The forward error correction mode of the link.
/// The requested forward-error correction method. If this is not
/// specified, the standard FEC for the underlying media will be applied
/// if it can be determined.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fec: Option<LinkFec>,
/// The link-layer discovery protocol (LLDP) configuration for the link.
Expand Down Expand Up @@ -23673,7 +23702,9 @@ pub mod types {
/// "type": "boolean"
/// },
/// "fec": {
/// "description": "The forward error correction mode of the link.",
/// "description": "The requested forward-error correction method. If
/// this is not specified, the standard FEC for the underlying media will be
/// applied if it can be determined.",
/// "oneOf": [
/// {
/// "type": "null"
Expand Down Expand Up @@ -23738,7 +23769,9 @@ pub mod types {
pub struct SwitchPortLinkConfig {
/// Whether or not the link has autonegotiation enabled.
pub autoneg: bool,
/// The forward error correction mode of the link.
/// The requested forward-error correction method. If this is not
/// specified, the standard FEC for the underlying media will be applied
/// if it can be determined.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fec: Option<LinkFec>,
/// The name of this link.
Expand Down Expand Up @@ -37205,13 +37238,17 @@ pub mod types {
pub struct InstanceUpdate {
auto_restart_policy: Result<Option<super::InstanceAutoRestartPolicy>, String>,
boot_disk: Result<Option<super::NameOrId>, String>,
memory: Result<super::ByteCount, String>,
ncpus: Result<super::InstanceCpuCount, String>,
}

impl Default for InstanceUpdate {
fn default() -> Self {
Self {
auto_restart_policy: Ok(Default::default()),
boot_disk: Ok(Default::default()),
memory: Err("no value supplied for memory".to_string()),
ncpus: Err("no value supplied for ncpus".to_string()),
}
}
}
Expand Down Expand Up @@ -37240,6 +37277,26 @@ pub mod types {
.map_err(|e| format!("error converting supplied value for boot_disk: {}", e));
self
}
pub fn memory<T>(mut self, value: T) -> Self
where
T: std::convert::TryInto<super::ByteCount>,
T::Error: std::fmt::Display,
{
self.memory = value
.try_into()
.map_err(|e| format!("error converting supplied value for memory: {}", e));
self
}
pub fn ncpus<T>(mut self, value: T) -> Self
where
T: std::convert::TryInto<super::InstanceCpuCount>,
T::Error: std::fmt::Display,
{
self.ncpus = value
.try_into()
.map_err(|e| format!("error converting supplied value for ncpus: {}", e));
self
}
}

impl std::convert::TryFrom<InstanceUpdate> for super::InstanceUpdate {
Expand All @@ -37248,6 +37305,8 @@ pub mod types {
Ok(Self {
auto_restart_policy: value.auto_restart_policy?,
boot_disk: value.boot_disk?,
memory: value.memory?,
ncpus: value.ncpus?,
})
}
}
Expand All @@ -37257,6 +37316,8 @@ pub mod types {
Self {
auto_restart_policy: Ok(value.auto_restart_policy),
boot_disk: Ok(value.boot_disk),
memory: Ok(value.memory),
ncpus: Ok(value.ncpus),
}
}
}
Expand Down

0 comments on commit 3e478c9

Please sign in to comment.