//
// SPDX-License-Identifier: AGPL-3.0
-import { Resource } from "./resource";
+import { Resource as R } from "./resource";
+import { Resource } from "../common/api/common-resource-service";
+import { ResourceKind } from "./kinds";
-export interface Collection extends Resource {
+export interface Collection extends R {
+}
+
+export interface CollectionResource extends Resource {
+ kind: ResourceKind.Collection;
+ name: string;
+ description: string;
+ properties: any;
+ portableDataHash: string;
+ manifestText: string;
+ replicationDesired: number;
+ replicationConfirmed: number;
+ replicationConfirmedAt: string;
+ trashAt: string;
+ deleteAt: string;
+ isTrashed: boolean;
}
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Resource } from "../common/api/common-resource-service";
+import { ResourceKind } from "./kinds";
+
+export interface ContainerRequestResource extends Resource {
+ kind: ResourceKind.ContainerRequest;
+ name: string;
+ description: string;
+ properties: any;
+ state: string;
+ requestingContainerUuid: string;
+ containerUuid: string;
+ containerCountMax: number;
+ mounts: any;
+ runtimeConstraints: any;
+ schedulingParameters: any;
+ containerImage: string;
+ environment: any;
+ cwd: string;
+ command: string[];
+ outputPath: string;
+ outputName: string;
+ outputTtl: number;
+ priority: number;
+ expiresAt: string;
+ useExisting: boolean;
+ logUuid: string;
+ outputUuid: string;
+ filters: string;
+
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Resource } from "../common/api/common-resource-service";
+import { ResourceKind } from "./kinds";
+
+export interface GroupResource extends Resource {
+ kind: ResourceKind.Group;
+ name: string;
+ groupClass: string;
+ description: string;
+ properties: string;
+ writeableBy: string[];
+ trashAt: string;
+ deleteAt: string;
+ isTrashed: boolean;
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export enum ResourceKind {
+ Collection = "arvados#collection",
+ ContainerRequest = "arvados#containerRequest",
+ Group = "arvados#group",
+ Process = "arvados#containerRequest",
+ Project = "arvados#group",
+ Workflow = "arvados#workflow"
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { ContainerRequestResource } from "./container-request";
+
+export type ProcessResource = ContainerRequestResource;
//
// SPDX-License-Identifier: AGPL-3.0
-import { Resource } from "./resource";
+import { Resource as R } from "./resource";
+import { GroupResource } from "./group";
-export interface Project extends Resource {
+export interface Project extends R {
+}
+
+export interface ProjectResource extends GroupResource {
+ groupClass: "project";
}
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Resource } from "../common/api/common-resource-service";
+import { ResourceKind } from "./kinds";
+
+export interface WorkflowResource extends Resource {
+ kind: ResourceKind.Workflow;
+ name: string;
+ description: string;
+ definition: string;
+}
\ No newline at end of file
import FilterBuilder from "../../common/api/filter-builder";
import OrderBuilder from "../../common/api/order-builder";
import { AxiosInstance } from "axios";
-
-interface GroupResource extends Resource {
- name: string;
- groupClass: string;
- description: string;
- properties: string;
- writeableBy: string[];
- trashAt: string;
- deleteAt: string;
- isTrashed: boolean;
-}
+import { GroupResource } from "../../models/group";
+import { CollectionResource } from "../../models/collection";
+import { ProjectResource } from "../../models/project";
+import { WorkflowResource } from "../../models/workflow";
+import { ProcessResource } from "../../models/process";
interface ContensArguments {
limit?: number;
recursive?: boolean;
}
+export type GroupContentsResource =
+ CollectionResource |
+ ProjectResource |
+ WorkflowResource |
+ ProcessResource;
+
export default class GroupsService extends CommonResourceService<GroupResource> {
constructor(serverApi: AxiosInstance) {
super(serverApi, "groups");
}
- contents (uuid: string, args: ContensArguments = {}): Promise<ListResults<Resource>> {
+ contents(uuid: string, args: ContensArguments = {}): Promise<ListResults<GroupContentsResource>> {
const { filters, order, ...other } = args;
const params = {
...other,
//
// SPDX-License-Identifier: AGPL-3.0
-import { Resource } from "../../common/api/common-resource-service";
import { DataItem } from "../../components/data-table/data-table";
+import { ResourceKind } from "../../models/kinds";
+import { GroupContentsResource } from "../../services/groups-service/groups-service";
export interface ProjectPanelItem extends DataItem {
uuid: string;
status?: string;
}
-export function resourceToDataItem(r: Resource): ProjectPanelItem {
+
+export function resourceToDataItem(r: GroupContentsResource): ProjectPanelItem {
return {
key: r.uuid,
uuid: r.uuid,
- name: r.uuid,
+ name: r.name,
kind: r.kind,
url: "",
owner: r.ownerUuid,
- lastModified: r.modifiedAt
+ lastModified: r.modifiedAt,
+ status: r.kind === ResourceKind.Process ? r.state : undefined
};
}