Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -553,16 +553,31 @@ paths:
summary: Worker
description: Return Edge Workers.
operationId: worker
security:
- OAuth2PasswordBearer: []
- HTTPBearer: []
parameters:
- name: worker_name_pattern
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Worker Name Pattern
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerCollectionResponse'
security:
- OAuth2PasswordBearer: []
- HTTPBearer: []
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/edge_worker/ui/jobs:
get:
tags:
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const UseMonitorServiceHealthKeyFn = (queryKey?: Array<unknown>) => [useM
export type UiServiceWorkerDefaultResponse = Awaited<ReturnType<typeof UiService.worker>>;
export type UiServiceWorkerQueryResult<TData = UiServiceWorkerDefaultResponse, TError = unknown> = UseQueryResult<TData, TError>;
export const useUiServiceWorkerKey = "UiServiceWorker";
export const UseUiServiceWorkerKeyFn = (queryKey?: Array<unknown>) => [useUiServiceWorkerKey, ...(queryKey ?? [])];
export const UseUiServiceWorkerKeyFn = ({ workerNamePattern }: {
workerNamePattern?: string;
} = {}, queryKey?: Array<unknown>) => [useUiServiceWorkerKey, ...(queryKey ?? [{ workerNamePattern }])];
export type UiServiceJobsDefaultResponse = Awaited<ReturnType<typeof UiService.jobs>>;
export type UiServiceJobsQueryResult<TData = UiServiceJobsDefaultResponse, TError = unknown> = UseQueryResult<TData, TError>;
export const useUiServiceJobsKey = "UiServiceJobs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export const ensureUseLogsServiceLogfilePathData = (queryClient: QueryClient, {
tryNumber: number;
}) => queryClient.ensureQueryData({ queryKey: Common.UseLogsServiceLogfilePathKeyFn({ authorization, dagId, mapIndex, runId, taskId, tryNumber }), queryFn: () => LogsService.logfilePath({ authorization, dagId, mapIndex, runId, taskId, tryNumber }) });
export const ensureUseMonitorServiceHealthData = (queryClient: QueryClient) => queryClient.ensureQueryData({ queryKey: Common.UseMonitorServiceHealthKeyFn(), queryFn: () => MonitorService.health() });
export const ensureUseUiServiceWorkerData = (queryClient: QueryClient) => queryClient.ensureQueryData({ queryKey: Common.UseUiServiceWorkerKeyFn(), queryFn: () => UiService.worker() });
export const ensureUseUiServiceWorkerData = (queryClient: QueryClient, { workerNamePattern }: {
workerNamePattern?: string;
} = {}) => queryClient.ensureQueryData({ queryKey: Common.UseUiServiceWorkerKeyFn({ workerNamePattern }), queryFn: () => UiService.worker({ workerNamePattern }) });
export const ensureUseUiServiceJobsData = (queryClient: QueryClient) => queryClient.ensureQueryData({ queryKey: Common.UseUiServiceJobsKeyFn(), queryFn: () => UiService.jobs() });
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export const prefetchUseLogsServiceLogfilePath = (queryClient: QueryClient, { au
tryNumber: number;
}) => queryClient.prefetchQuery({ queryKey: Common.UseLogsServiceLogfilePathKeyFn({ authorization, dagId, mapIndex, runId, taskId, tryNumber }), queryFn: () => LogsService.logfilePath({ authorization, dagId, mapIndex, runId, taskId, tryNumber }) });
export const prefetchUseMonitorServiceHealth = (queryClient: QueryClient) => queryClient.prefetchQuery({ queryKey: Common.UseMonitorServiceHealthKeyFn(), queryFn: () => MonitorService.health() });
export const prefetchUseUiServiceWorker = (queryClient: QueryClient) => queryClient.prefetchQuery({ queryKey: Common.UseUiServiceWorkerKeyFn(), queryFn: () => UiService.worker() });
export const prefetchUseUiServiceWorker = (queryClient: QueryClient, { workerNamePattern }: {
workerNamePattern?: string;
} = {}) => queryClient.prefetchQuery({ queryKey: Common.UseUiServiceWorkerKeyFn({ workerNamePattern }), queryFn: () => UiService.worker({ workerNamePattern }) });
export const prefetchUseUiServiceJobs = (queryClient: QueryClient) => queryClient.prefetchQuery({ queryKey: Common.UseUiServiceJobsKeyFn(), queryFn: () => UiService.jobs() });
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const useLogsServiceLogfilePath = <TData = Common.LogsServiceLogfilePathD
tryNumber: number;
}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseLogsServiceLogfilePathKeyFn({ authorization, dagId, mapIndex, runId, taskId, tryNumber }, queryKey), queryFn: () => LogsService.logfilePath({ authorization, dagId, mapIndex, runId, taskId, tryNumber }) as TData, ...options });
export const useMonitorServiceHealth = <TData = Common.MonitorServiceHealthDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseMonitorServiceHealthKeyFn(queryKey), queryFn: () => MonitorService.health() as TData, ...options });
export const useUiServiceWorker = <TData = Common.UiServiceWorkerDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseUiServiceWorkerKeyFn(queryKey), queryFn: () => UiService.worker() as TData, ...options });
export const useUiServiceWorker = <TData = Common.UiServiceWorkerDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>({ workerNamePattern }: {
workerNamePattern?: string;
} = {}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseUiServiceWorkerKeyFn({ workerNamePattern }, queryKey), queryFn: () => UiService.worker({ workerNamePattern }) as TData, ...options });
export const useUiServiceJobs = <TData = Common.UiServiceJobsDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseUiServiceJobsKeyFn(queryKey), queryFn: () => UiService.jobs() as TData, ...options });
export const useJobsServiceFetch = <TData = Common.JobsServiceFetchMutationResult, TError = unknown, TContext = unknown>(options?: Omit<UseMutationOptions<TData, TError, {
authorization: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export const useLogsServiceLogfilePathSuspense = <TData = Common.LogsServiceLogf
tryNumber: number;
}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseLogsServiceLogfilePathKeyFn({ authorization, dagId, mapIndex, runId, taskId, tryNumber }, queryKey), queryFn: () => LogsService.logfilePath({ authorization, dagId, mapIndex, runId, taskId, tryNumber }) as TData, ...options });
export const useMonitorServiceHealthSuspense = <TData = Common.MonitorServiceHealthDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseMonitorServiceHealthKeyFn(queryKey), queryFn: () => MonitorService.health() as TData, ...options });
export const useUiServiceWorkerSuspense = <TData = Common.UiServiceWorkerDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseUiServiceWorkerKeyFn(queryKey), queryFn: () => UiService.worker() as TData, ...options });
export const useUiServiceWorkerSuspense = <TData = Common.UiServiceWorkerDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>({ workerNamePattern }: {
workerNamePattern?: string;
} = {}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseUiServiceWorkerKeyFn({ workerNamePattern }, queryKey), queryFn: () => UiService.worker({ workerNamePattern }) as TData, ...options });
export const useUiServiceJobsSuspense = <TData = Common.UiServiceJobsDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseUiServiceJobsKeyFn(queryKey), queryFn: () => UiService.jobs() as TData, ...options });
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { CancelablePromise } from './core/CancelablePromise';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { FetchData, FetchResponse, StateData, StateResponse, LogfilePathData, LogfilePathResponse, PushLogsData, PushLogsResponse, RegisterData, RegisterResponse, SetStateData, SetStateResponse, UpdateQueuesData, UpdateQueuesResponse, HealthResponse, WorkerResponse, JobsResponse, RequestWorkerMaintenanceData, RequestWorkerMaintenanceResponse, UpdateWorkerMaintenanceData, UpdateWorkerMaintenanceResponse, ExitWorkerMaintenanceData, ExitWorkerMaintenanceResponse, RequestWorkerShutdownData, RequestWorkerShutdownResponse, DeleteWorkerData, DeleteWorkerResponse, AddWorkerQueueData, AddWorkerQueueResponse, RemoveWorkerQueueData, RemoveWorkerQueueResponse } from './types.gen';
import type { FetchData, FetchResponse, StateData, StateResponse, LogfilePathData, LogfilePathResponse, PushLogsData, PushLogsResponse, RegisterData, RegisterResponse, SetStateData, SetStateResponse, UpdateQueuesData, UpdateQueuesResponse, HealthResponse, WorkerData, WorkerResponse, JobsResponse, RequestWorkerMaintenanceData, RequestWorkerMaintenanceResponse, UpdateWorkerMaintenanceData, UpdateWorkerMaintenanceResponse, ExitWorkerMaintenanceData, ExitWorkerMaintenanceResponse, RequestWorkerShutdownData, RequestWorkerShutdownResponse, DeleteWorkerData, DeleteWorkerResponse, AddWorkerQueueData, AddWorkerQueueResponse, RemoveWorkerQueueData, RemoveWorkerQueueResponse } from './types.gen';

export class JobsService {
/**
Expand Down Expand Up @@ -263,13 +263,21 @@ export class UiService {
/**
* Worker
* Return Edge Workers.
* @param data The data for the request.
* @param data.workerNamePattern
* @returns WorkerCollectionResponse Successful Response
* @throws ApiError
*/
public static worker(): CancelablePromise<WorkerResponse> {
public static worker(data: WorkerData = {}): CancelablePromise<WorkerResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/edge_worker/ui/worker'
url: '/edge_worker/ui/worker',
query: {
worker_name_pattern: data.workerNamePattern
},
errors: {
422: 'Validation Error'
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ export type HealthResponse = {
[key: string]: (string);
};

export type WorkerData = {
workerNamePattern?: string | null;
};

export type WorkerResponse = WorkerCollectionResponse;

export type JobsResponse = JobCollectionResponse;
Expand Down Expand Up @@ -690,11 +694,16 @@ export type $OpenApiTs = {
};
'/edge_worker/ui/worker': {
get: {
req: WorkerData;
res: {
/**
* Successful Response
*/
200: WorkerCollectionResponse;
/**
* Validation Error
*/
422: HTTPValidationError;
};
};
};
Expand Down
Loading