--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Resource } from "./resource";
+import { ResourceKind } from '~/models/resource';
+
+export enum LogEventType {
+ CREATE = 'create',
+ UPDATE = 'update',
+ DISPATCH = 'dispatch',
+ CRUNCH_RUN = 'crunch-run',
+ CRUNCHSTAT = 'crunchstat',
+ HOSTSTAT = 'hoststat',
+ NODE_INFO = 'node-info',
+ ARV_MOUNT = 'arv-mount',
+ STDOUT = 'stdout',
+ STDERR = 'stderr',
+}
+
+export interface LogResource extends Resource {
+ kind: ResourceKind.LOG;
+ objectUuid: string;
+ eventAt: string;
+ eventType: string;
+ summary: string;
+ properties: any;
+}
CONTAINER = "arvados#container",
CONTAINER_REQUEST = "arvados#containerRequest",
GROUP = "arvados#group",
+ LOG = "arvados#log",
PROCESS = "arvados#containerRequest",
PROJECT = "arvados#group",
USER = "arvados#user",
CONTAINER = 'dz642',
CONTAINER_REQUEST = 'xvhdp',
GROUP = 'j7d0g',
+ LOG = '57u5n',
USER = 'tpzed',
}
return ResourceKind.CONTAINER_REQUEST;
case ResourceObjectType.CONTAINER:
return ResourceKind.CONTAINER;
+ case ResourceObjectType.LOG:
+ return ResourceKind.LOG;
default:
return undefined;
}
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { CommonResourceService } from "~/common/api/common-resource-service";
+import { AxiosInstance } from "axios";
+import { LogResource } from '~/models/log';
+
+export class LogService extends CommonResourceService<LogResource> {
+ constructor(serverApi: AxiosInstance) {
+ super(serverApi, "logs");
+ }
+}
import { ResourceKind } from "~/models/resource";
import { ContainerRequestService } from './container-request-service/container-request-service';
import { ContainerService } from './container-service/container-service';
+import { LogService } from './log-service/log-service';
export type ServiceRepository = ReturnType<typeof createServices>;
const webdavClient = new WebDAV();
webdavClient.defaults.baseURL = config.keepWebServiceUrl;
+ const containerRequestService = new ContainerRequestService(apiClient);
+ const containerService = new ContainerService(apiClient);
const groupsService = new GroupsService(apiClient);
const keepService = new KeepService(apiClient);
const linkService = new LinkService(apiClient);
+ const logService = new LogService(apiClient);
const projectService = new ProjectService(apiClient);
const userService = new UserService(apiClient);
- const containerRequestService = new ContainerRequestService(apiClient);
- const containerService = new ContainerService(apiClient);
const ancestorsService = new AncestorService(groupsService, userService);
const authService = new AuthService(apiClient, config.rootUrl);
groupsService,
keepService,
linkService,
+ logService,
projectService,
tagService,
userService,
+import { LogEventType } from '../models/log';
// Copyright (C) The Arvados Authors. All rights reserved.
//
// SPDX-License-Identifier: AGPL-3.0
-export enum ResourceEventMessageType {
- CREATE = 'create',
- UPDATE = 'update',
- HOTSTAT = 'hotstat',
- CRUNCH_RUN = 'crunch-run',
- NODE_INFO = 'node-info',
-}
-
export interface ResourceEventMessage {
eventAt: string;
- eventType: ResourceEventMessageType;
+ eventType: LogEventType;
id: string;
msgID: string;
objectKind: string;
import { AuthService } from '~/services/auth-service/auth-service';
import { Config } from '~/common/config';
import { WebSocketService } from './websocket-service';
-import { ResourceEventMessage, ResourceEventMessageType } from './resource-event-message';
+import { ResourceEventMessage } from './resource-event-message';
import { ResourceKind } from '~/models/resource';
import { loadProcess } from '~/store/processes/processes-actions';
import { loadContainers } from '../store/processes/processes-actions';
import { FilterBuilder } from '~/common/api/filter-builder';
+import { LogEventType } from '../models/log';
export const initWebSocket = (config: Config, authService: AuthService, store: RootStore) => {
const webSocketService = new WebSocketService(config.websocketUrl, authService);
};
const messageListener = (store: RootStore) => (message: ResourceEventMessage) => {
- if (message.eventType === ResourceEventMessageType.CREATE || message.eventType === ResourceEventMessageType.UPDATE) {
+ if (message.eventType === LogEventType.CREATE || message.eventType === LogEventType.UPDATE) {
switch (message.objectKind) {
case ResourceKind.CONTAINER_REQUEST:
return store.dispatch(loadProcess(message.objectUuid));