Skip to content

Commit

Permalink
Rebuilt with latest dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
oxide-reflector-bot[bot] committed Nov 19, 2024
1 parent d158923 commit 2d46797
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
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
22 changes: 21 additions & 1 deletion oxide.json
Original file line number Diff line number Diff line change
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
52 changes: 52 additions & 0 deletions sdk/src/generated_sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13021,6 +13021,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 +13067,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 +13114,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 @@ -37213,13 +37237,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 @@ -37248,6 +37276,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 @@ -37256,6 +37304,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 @@ -37265,6 +37315,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 2d46797

Please sign in to comment.