Skip to content

Commit 123884c

Browse files
authored
chore: update API specs (#4181)
1 parent fb773f6 commit 123884c

16 files changed

Lines changed: 242 additions & 224 deletions

client/src/features/dashboardV2/DashboardV2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ function GroupsList({ data, error, isLoading }: GroupListProps) {
422422
}
423423

424424
function SessionsDashboard() {
425-
const { data: sessions, error, isLoading } = useGetSessionsQueryV2();
425+
const { data: sessions, error, isLoading } = useGetSessionsQueryV2({});
426426
const totalSessions = sessions ? sessions?.length : 0;
427427
return (
428428
<Card data-cy="sessions-container">

client/src/features/sessionsV2/SessionList/SessionLauncherDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function SessionLauncherDisplay({
6969
});
7070
}, [launcherHash, setHash]);
7171

72-
const { data: sessions } = useGetSessionsQueryV2();
72+
const { data: sessions } = useGetSessionsQueryV2({});
7373

7474
const filteredSessions = useMemo(
7575
() =>

client/src/features/sessionsV2/SessionShowPage/ShowSessionPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default function ShowSessionPage() {
108108
data: sessions,
109109
isLoading,
110110
isFetching,
111-
} = useGetSessionsQuery(undefined, { refetchOnMountOrArgChange: true });
111+
} = useGetSessionsQuery({}, { refetchOnMountOrArgChange: true });
112112

113113
const thisSession = useMemo(() => {
114114
if (sessions == null) {

client/src/features/sessionsV2/SessionStyles.constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const SESSION_STATES = {
3333
STOPPING: "stopping",
3434
HIBERNATED: "hibernated",
3535
FAILED: "failed",
36+
SUCCEEDED: "succeeded",
3637
} as const;
3738

3839
export const SESSION_STYLES = {
@@ -98,6 +99,7 @@ export const SESSION_TITLE = {
9899
[SESSION_STATES.STOPPING]: "Shutting down my session...",
99100
[SESSION_STATES.HIBERNATED]: "My paused session",
100101
[SESSION_STATES.FAILED]: "Error in my session",
102+
[SESSION_STATES.SUCCEEDED]: "Session succeeded (TBD)",
101103
default: "Unknown status",
102104
};
103105

@@ -107,5 +109,6 @@ export const SESSION_TITLE_DASHBOARD = {
107109
[SESSION_STATES.STOPPING]: "Shutting down session...",
108110
[SESSION_STATES.HIBERNATED]: "Paused session",
109111
[SESSION_STATES.FAILED]: "Error in session",
112+
[SESSION_STATES.SUCCEEDED]: "Session succeeded (TBD)",
110113
default: "Unknown status",
111114
};

client/src/features/sessionsV2/SessionsV2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default function SessionsV2({ project }: SessionsV2Props) {
7676
data: sessions,
7777
error: sessionsError,
7878
isLoading: isLoadingSessions,
79-
} = useGetSessionsQueryV2();
79+
} = useGetSessionsQueryV2({});
8080

8181
const isLoading = isLoadingLaunchers || isLoadingSessions;
8282
const error = launchersError || sessionsError;

client/src/features/sessionsV2/api/computeResources.generated-api.ts

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -536,30 +536,30 @@ export type PutUsersByUserIdResourcePoolsApiArg = {
536536
export type GetVersionApiResponse = /** status 200 The error */ Version;
537537
export type GetVersionApiArg = void;
538538
export type Name = string;
539+
export type DefaultFlag = boolean;
539540
export type Cpu = number;
540541
export type Memory = number;
541542
export type Gpu = number;
542543
export type Storage = number;
543-
export type IntegerId = number;
544-
export type DefaultFlag = boolean;
545544
export type K8SLabel = string;
546545
export type K8SLabelList = K8SLabel[];
547546
export type NodeAffinity = {
548547
key: K8SLabel;
549548
required_during_scheduling?: boolean;
550549
};
551550
export type NodeAffinityList = NodeAffinity[];
551+
export type IntegerId = number;
552552
export type ResourceClassWithId = {
553553
name: Name;
554+
default: DefaultFlag;
554555
cpu: Cpu;
555556
memory: Memory;
556557
gpu: Gpu;
557558
max_storage: Storage;
558559
default_storage: Storage;
559-
id: IntegerId;
560-
default: DefaultFlag;
561560
tolerations?: K8SLabelList;
562561
node_affinities?: NodeAffinityList;
562+
id: IntegerId;
563563
};
564564
export type ErrorResponse = {
565565
error: {
@@ -633,18 +633,12 @@ export type QuotaWithId = {
633633
gpu: Gpu;
634634
id: Name;
635635
};
636-
export type ResourceClassWithIdFiltered = {
637-
name: Name;
638-
cpu: Cpu;
639-
memory: Memory;
640-
gpu: Gpu;
641-
max_storage: Storage;
642-
default_storage: Storage;
643-
id: IntegerId;
644-
default: DefaultFlag;
636+
export type UsageHoursRemaining = number;
637+
export type UsageHoursTotal = number;
638+
export type ResourceClassWithIdFiltered = ResourceClassWithId & {
645639
matching?: boolean;
646-
tolerations?: K8SLabelList;
647-
node_affinities?: NodeAffinityList;
640+
usage_hours_remaining?: UsageHoursRemaining;
641+
usage_hours_total?: UsageHoursTotal;
648642
};
649643
export type PublicFlag = boolean;
650644
export type RemoteConfigurationFirecrestProviderId = string;
@@ -673,6 +667,7 @@ export type IdleThreshold = number;
673667
export type HibernationThreshold = number;
674668
export type HibernationWarningPeriod = number;
675669
export type RuntimePlatform = "linux/amd64" | "linux/arm64";
670+
export type CreditsUsed = number;
676671
export type ResourcePoolWithIdFiltered = {
677672
quota?: QuotaWithId;
678673
classes: ResourceClassWithIdFiltered[];
@@ -686,6 +681,7 @@ export type ResourcePoolWithIdFiltered = {
686681
hibernation_warning_period?: HibernationWarningPeriod;
687682
cluster_id?: Ulid;
688683
platform: RuntimePlatform;
684+
credits_used?: CreditsUsed;
689685
};
690686
export type ResourcePoolsWithIdFiltered = ResourcePoolWithIdFiltered[];
691687
export type CpuFilter = number;
@@ -715,12 +711,12 @@ export type QuotaWithOptionalId = {
715711
};
716712
export type ResourceClass = {
717713
name: Name;
714+
default: DefaultFlag;
718715
cpu: Cpu;
719716
memory: Memory;
720717
gpu: Gpu;
721718
max_storage: Storage;
722719
default_storage: Storage;
723-
default: DefaultFlag;
724720
tolerations?: K8SLabelList;
725721
node_affinities?: NodeAffinityList;
726722
};
@@ -757,21 +753,21 @@ export type QuotaPatch = {
757753
memory?: Memory;
758754
gpu?: Gpu;
759755
};
760-
export type DefaultFlagPatch = boolean;
761-
export type ResourceClassPatchWithId = {
756+
export type ResourceClassProperties = {
762757
name?: Name;
758+
default?: DefaultFlag;
763759
cpu?: Cpu;
764760
memory?: Memory;
765761
gpu?: Gpu;
766762
max_storage?: Storage;
767763
default_storage?: Storage;
768-
id: IntegerId;
769-
default?: DefaultFlagPatch;
770764
tolerations?: K8SLabelList;
771765
node_affinities?: NodeAffinityList;
772766
};
767+
export type ResourceClassPatchWithId = ResourceClassProperties & {
768+
id: IntegerId;
769+
};
773770
export type ResourceClassesPatchWithId = ResourceClassPatchWithId[];
774-
export type PublicFlagPatch = boolean;
775771
export type RemoteConfigurationPatchReset = object;
776772
export type RemoteConfigurationFirecrestPatch = {
777773
/** Kind of remote resource pool */
@@ -795,8 +791,8 @@ export type ResourcePoolPatch = {
795791
quota?: QuotaPatch;
796792
classes?: ResourceClassesPatchWithId;
797793
name?: Name;
798-
public?: PublicFlagPatch;
799-
default?: DefaultFlagPatch;
794+
public?: PublicFlag;
795+
default?: DefaultFlag;
800796
remote?: RemoteConfigurationPatch;
801797
idle_threshold?: IdleThreshold;
802798
hibernation_threshold?: HibernationThreshold;
@@ -805,17 +801,7 @@ export type ResourcePoolPatch = {
805801
platform?: RuntimePlatform;
806802
};
807803
export type ResourceClassesWithIdResponse = ResourceClassWithId[];
808-
export type ResourceClassPatch = {
809-
name?: Name;
810-
cpu?: Cpu;
811-
memory?: Memory;
812-
gpu?: Gpu;
813-
max_storage?: Storage;
814-
default_storage?: Storage;
815-
default?: DefaultFlagPatch;
816-
tolerations?: K8SLabelList;
817-
node_affinities?: NodeAffinityList;
818-
};
804+
export type ResourceClassPatch = ResourceClassProperties;
819805
export type NodeAffinityListResponse = NodeAffinity[];
820806
export type UserId = string;
821807
export type PoolUserWithId = {

0 commit comments

Comments
 (0)