-
Notifications
You must be signed in to change notification settings - Fork 45
Move /global-images/
to live under /system/
as per RFD-288
#1678
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
Changes from all commits
096ead2
5f818e4
03af487
7b069c8
264ca51
c5cc665
c78ea25
3d67244
42f227d
082bf3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,11 +234,11 @@ pub fn external_api() -> NexusApiDescription { | |
api.register(silo_identity_provider_create)?; | ||
api.register(silo_identity_provider_view)?; | ||
|
||
api.register(image_global_list)?; | ||
api.register(image_global_create)?; | ||
api.register(image_global_view)?; | ||
api.register(image_global_view_by_id)?; | ||
api.register(image_global_delete)?; | ||
api.register(system_image_list)?; | ||
api.register(system_image_create)?; | ||
api.register(system_image_view)?; | ||
api.register(system_image_view_by_id)?; | ||
api.register(system_image_delete)?; | ||
|
||
api.register(updates_refresh)?; | ||
api.register(user_list)?; | ||
|
@@ -2243,16 +2243,16 @@ async fn instance_disk_detach( | |
|
||
// Images | ||
|
||
/// List global images | ||
/// List system-wide images | ||
/// | ||
/// Returns a list of all the global images. Global images are returned sorted | ||
/// Returns a list of all the system-wide images. System-wide images are returned sorted | ||
/// by creation date, with the most recent images appearing first. | ||
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. Does this comment still make sense? I'm wary of saying something like List system images given @kc8apf's comment on |
||
#[endpoint { | ||
method = GET, | ||
path = "/images", | ||
tags = ["images:global"], | ||
path = "/system/images", | ||
tags = ["system"], | ||
}] | ||
async fn image_global_list( | ||
async fn system_image_list( | ||
rqctx: Arc<RequestContext<Arc<ServerContext>>>, | ||
query_params: Query<PaginatedByName>, | ||
) -> Result<HttpResponseOk<ResultsPage<GlobalImage>>, HttpError> { | ||
|
@@ -2280,16 +2280,16 @@ async fn image_global_list( | |
apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await | ||
} | ||
|
||
/// Create a global image | ||
/// Create a system-wide image | ||
/// | ||
/// Create a new global image. This image can then be used by any user as a | ||
/// Create a new system-wide image. This image can then be used by any user in any silo as a | ||
/// base for instances. | ||
#[endpoint { | ||
method = POST, | ||
path = "/images", | ||
tags = ["images:global"] | ||
path = "/system/images", | ||
tags = ["system"] | ||
}] | ||
async fn image_global_create( | ||
async fn system_image_create( | ||
rqctx: Arc<RequestContext<Arc<ServerContext>>>, | ||
new_image: TypedBody<params::GlobalImageCreate>, | ||
) -> Result<HttpResponseCreated<GlobalImage>, HttpError> { | ||
|
@@ -2310,15 +2310,15 @@ struct GlobalImagePathParam { | |
image_name: Name, | ||
} | ||
|
||
/// Fetch a global image | ||
/// Fetch a system-wide image | ||
/// | ||
/// Returns the details of a specific global image. | ||
/// Returns the details of a specific system-wide image. | ||
#[endpoint { | ||
method = GET, | ||
path = "/images/{image_name}", | ||
tags = ["images:global"], | ||
path = "/system/images/{image_name}", | ||
tags = ["system"], | ||
}] | ||
async fn image_global_view( | ||
async fn system_image_view( | ||
rqctx: Arc<RequestContext<Arc<ServerContext>>>, | ||
path_params: Path<GlobalImagePathParam>, | ||
) -> Result<HttpResponseOk<GlobalImage>, HttpError> { | ||
|
@@ -2334,13 +2334,13 @@ async fn image_global_view( | |
apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await | ||
} | ||
|
||
/// Fetch a global image by id | ||
/// Fetch a system-wide image by id | ||
#[endpoint { | ||
method = GET, | ||
path = "/by-id/global-images/{id}", | ||
tags = ["images:global"], | ||
path = "/system/by-id/images/{id}", | ||
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 don't feel too strongly either way but I kind of thought this would be 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. It's not bizarre, that certainly is a plausible approach. The reason I went with 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. My reasoning is that it simplifies the algorithm for constructing a 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. But yeah I see the other side too. "Why is this system route not prefixed with 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 don't feel strongly about this but 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. Yeah, I’m fine with it. We’ll try to make it easy to see in the API docs. |
||
tags = ["system"], | ||
}] | ||
async fn image_global_view_by_id( | ||
async fn system_image_view_by_id( | ||
rqctx: Arc<RequestContext<Arc<ServerContext>>>, | ||
path_params: Path<ByIdPathParams>, | ||
) -> Result<HttpResponseOk<GlobalImage>, HttpError> { | ||
|
@@ -2356,17 +2356,17 @@ async fn image_global_view_by_id( | |
apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await | ||
} | ||
|
||
/// Delete a global image | ||
/// Delete a system-wide image | ||
/// | ||
/// Permanently delete a global image. This operation cannot be undone. Any | ||
/// instances using the global image will continue to run, however new instances | ||
/// Permanently delete a system-wide image. This operation cannot be undone. Any | ||
/// instances using the system-wide image will continue to run, however new instances | ||
/// can not be created with this image. | ||
#[endpoint { | ||
method = DELETE, | ||
path = "/images/{image_name}", | ||
tags = ["images:global"], | ||
path = "/system/images/{image_name}", | ||
tags = ["system"], | ||
}] | ||
async fn image_global_delete( | ||
async fn system_image_delete( | ||
rqctx: Arc<RequestContext<Arc<ServerContext>>>, | ||
path_params: Path<GlobalImagePathParam>, | ||
) -> Result<HttpResponseDeleted, HttpError> { | ||
|
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.
We need some way to differentiate this, but I do wonder if this prefix is correct given that we're not using prefixes for other things.
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.
Punt. I think it's tolerable.