fix: storage api alignment
This commit is contained in:
@@ -1,23 +1,57 @@
|
||||
export interface FormData {
|
||||
export type ImagePullPolicy = 'Always' | 'IfNotPresent' | 'Never';
|
||||
|
||||
export interface InstanceEnvVar {
|
||||
name: string;
|
||||
description?: string;
|
||||
image?: string;
|
||||
instance_type?: string;
|
||||
instance_type_id?: number;
|
||||
template_id?: number;
|
||||
gpu_count?: number;
|
||||
replicas?: number;
|
||||
storage_mode?: string;
|
||||
storage_id?: number;
|
||||
local_storage_size_gb?: number;
|
||||
cluster_id?: number;
|
||||
mount_path?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export interface InstancePort {
|
||||
port: number;
|
||||
protocol?: string;
|
||||
}
|
||||
|
||||
export interface InstanceResources {
|
||||
cpu?: string;
|
||||
ram?: string;
|
||||
localStorage?: string;
|
||||
accelerator?: string;
|
||||
}
|
||||
|
||||
export interface InstanceVolume {
|
||||
ephemeral?: {
|
||||
capacity?: string;
|
||||
};
|
||||
persistent?: {
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
|
||||
// instance form data
|
||||
export interface FormData {
|
||||
metadata: {
|
||||
name: string;
|
||||
namespace: string;
|
||||
};
|
||||
spec: {
|
||||
image: string;
|
||||
displayName: string;
|
||||
command: string[];
|
||||
ports: InstancePort[];
|
||||
env: InstanceEnvVar[];
|
||||
volumeMount: string;
|
||||
resources: InstanceResources;
|
||||
description: string;
|
||||
volume: InstanceVolume;
|
||||
sshPublicKey: {
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// instance list item
|
||||
export interface ListItem extends FormData {
|
||||
id: number;
|
||||
status?: string;
|
||||
endpoint?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
@@ -31,3 +65,42 @@ export interface InstanceItem {
|
||||
gpu_count: number;
|
||||
status: string; // available, unavailable
|
||||
}
|
||||
|
||||
export interface InstanceTypeSpec {
|
||||
acceleratable: boolean;
|
||||
computeCapability?: string;
|
||||
family?: string;
|
||||
group: string;
|
||||
manufacturer?: string;
|
||||
memory?: string;
|
||||
product?: string;
|
||||
sliced?: number;
|
||||
}
|
||||
|
||||
export interface InstanceTypeResource {
|
||||
capacity?: string;
|
||||
onceMaxRequest?: string;
|
||||
remaining?: string;
|
||||
}
|
||||
|
||||
export interface InstanceTypeStatus {
|
||||
accelerator: InstanceTypeResource;
|
||||
cpu: InstanceTypeResource;
|
||||
localStorage: InstanceTypeResource;
|
||||
phase: string;
|
||||
phaseMessage?: string;
|
||||
ram: InstanceTypeResource;
|
||||
}
|
||||
|
||||
export interface InstanceTypeItem {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
metadata: {
|
||||
name: string;
|
||||
namespace: string;
|
||||
};
|
||||
id: number;
|
||||
name: string;
|
||||
spec: InstanceTypeSpec;
|
||||
status: InstanceTypeStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user