cockpit: add cockpit image request types
Update the types to include some cockpit specific fields to the image requests. We could also update the image-builder-crc api openapi specs, but this would need further discussion
This commit is contained in:
parent
2f765a1d4b
commit
c88171da19
1 changed files with 57 additions and 0 deletions
|
|
@ -1,3 +1,15 @@
|
|||
import {
|
||||
Awss3UploadRequestOptions,
|
||||
AwsUploadRequestOptions,
|
||||
ComposeRequest,
|
||||
ComposesResponseItem,
|
||||
CreateBlueprintApiArg,
|
||||
CreateBlueprintRequest,
|
||||
ImageRequest,
|
||||
UpdateBlueprintApiArg,
|
||||
UploadTypes,
|
||||
} from '../imageBuilderApi';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type Params = Record<string, any>;
|
||||
export type Method = 'GET' | 'DELETE' | 'POST' | 'PUT' | 'PATCH'; // We can add more if we need
|
||||
|
|
@ -47,3 +59,48 @@ export type WorkerConfigRequest = {
|
|||
export type UpdateWorkerConfigApiArg = {
|
||||
updateWorkerConfigRequest: WorkerConfigRequest | undefined;
|
||||
};
|
||||
|
||||
export type CockpitUploadTypes = UploadTypes | 'local';
|
||||
|
||||
export type CockpitAwsUploadRequestOptions = AwsUploadRequestOptions & {
|
||||
region?: string | undefined;
|
||||
};
|
||||
|
||||
type CockpitUploadRequest = {
|
||||
type: CockpitUploadTypes;
|
||||
options: Awss3UploadRequestOptions | CockpitAwsUploadRequestOptions;
|
||||
};
|
||||
|
||||
export type CockpitImageRequest = Omit<ImageRequest, 'upload_request'> & {
|
||||
upload_request: CockpitUploadRequest;
|
||||
};
|
||||
|
||||
export type CockpitCreateBlueprintRequest = Omit<
|
||||
CreateBlueprintRequest,
|
||||
'image_requests'
|
||||
> & {
|
||||
image_requests: CockpitImageRequest[];
|
||||
};
|
||||
|
||||
export type CockpitCreateBlueprintApiArg = Omit<
|
||||
CreateBlueprintApiArg,
|
||||
'createBlueprintRequest'
|
||||
> & {
|
||||
createBlueprintRequest: CockpitCreateBlueprintRequest;
|
||||
};
|
||||
|
||||
export type CockpitUpdateBlueprintApiArg = Omit<
|
||||
UpdateBlueprintApiArg,
|
||||
'createBlueprintRequest'
|
||||
> & {
|
||||
createBlueprintRequest: CockpitCreateBlueprintRequest;
|
||||
};
|
||||
|
||||
export type CockpitComposesResponseItem = Omit<
|
||||
ComposesResponseItem,
|
||||
'request'
|
||||
> & {
|
||||
request: Omit<ComposeRequest, 'image_requests'> & {
|
||||
image_requests: CockpitImageRequest[];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue