api: update image builder api via npm run api

This commit is contained in:
Anna Vítová 2024-01-26 15:01:19 +01:00 committed by Thomas Lavocat
parent 22d8eb6634
commit 04e02b9426
3 changed files with 33 additions and 0 deletions

View file

@ -23,6 +23,7 @@ const config: ConfigFile = {
'composeBlueprint',
'getBlueprints',
'getBlueprintComposes',
'deleteBlueprint',
],
};

View file

@ -537,6 +537,22 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPErrorList'
delete:
summary: delete a blueprint
description: |
Deletes all versions of Blueprint, the compose will still count towards quota.
operationId: deleteBlueprint
tags:
- blueprint
responses:
'204':
description: Successfully deleted
'404':
description: Blueprint to delete was not found
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPErrorList'
/experimental/blueprints/{id}/compose:
post:
parameters:

View file

@ -110,6 +110,15 @@ const injectedRtkApi = api.injectEndpoints({
body: queryArg.createBlueprintRequest,
}),
}),
deleteBlueprint: build.mutation<
DeleteBlueprintApiResponse,
DeleteBlueprintApiArg
>({
query: (queryArg) => ({
url: `/experimental/blueprints/${queryArg.id}`,
method: "DELETE",
}),
}),
composeBlueprint: build.mutation<
ComposeBlueprintApiResponse,
ComposeBlueprintApiArg
@ -242,6 +251,12 @@ export type UpdateBlueprintApiArg = {
/** details of blueprint */
createBlueprintRequest: CreateBlueprintRequest;
};
export type DeleteBlueprintApiResponse =
/** status 204 Successfully deleted */ void;
export type DeleteBlueprintApiArg = {
/** UUID of a blueprint */
id: string;
};
export type ComposeBlueprintApiResponse =
/** status 201 compose was created */ ComposeResponse[];
export type ComposeBlueprintApiArg = {
@ -782,6 +797,7 @@ export const {
useGetBlueprintsQuery,
useCreateBlueprintMutation,
useUpdateBlueprintMutation,
useDeleteBlueprintMutation,
useComposeBlueprintMutation,
useGetBlueprintComposesQuery,
} = injectedRtkApi;