-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use more PhysicalDiskUuid #7163
Conversation
@@ -208,8 +209,10 @@ impl super::Nexus { | |||
opctx: &'a OpContext, | |||
disk_selector: ¶ms::PhysicalDiskPath, | |||
) -> Result<lookup::PhysicalDisk<'a>, Error> { | |||
Ok(lookup::LookupPath::new(&opctx, &self.db_datastore) | |||
.physical_disk(disk_selector.disk_id)) | |||
// XXX how to do typed UUID as part of dropshot path? |
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.
This is one thing I didn't know how to do, or if dropshot even supported it. Comments welcome :)
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.
It should just work if you change the type of params::PhysicalDiskPath::disk_id
to be PhysicalDiskUuid
instead of Uuid
. However, I'm not sure we want to: this would affect the public API and would "leak" our typed UUIDs:
--- a/openapi/nexus.json
+++ b/openapi/nexus.json
@@ -4786,8 +4786,7 @@
"description": "ID of the physical disk",
"required": true,
"schema": {
- "type": "string",
- "format": "uuid"
+ "$ref": "#/components/schemas/TypedUuidForPhysicalDiskKind"
}
}
],
@@ -22499,6 +22498,10 @@
"ram_provisioned"
]
},
+ "TypedUuidForPhysicalDiskKind": {
+ "type": "string",
+ "format": "uuid"
+ },
"NameSortMode": {
"description": "Supported set of sort modes for scanning by name only\n\nCurrently, we only support scanning in ascending order.",
"oneOf": [
I vaguely remember @ahl suggesting this wasn't something we wanted, but can't find the details of that suggestion at the moment. Maybe this doesn't translate particularly well for non-Rust OpenAPI clients?
looking into it now |
No description provided.