Skip to content

Commit

Permalink
Merge pull request #219 from Digital-Engineering/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
DnOberon authored and GitHub Enterprise committed Feb 7, 2023
2 parents 6ddce67 + c86508f commit f93adb3
Show file tree
Hide file tree
Showing 93 changed files with 5,170 additions and 6,949 deletions.
218 changes: 218 additions & 0 deletions API Documentation/Core.swagger_collection.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
openapi: 3.0.1
x-stoplight:
id: tr5pyoyxdqv3w
info:
title: Deep Lynx
description: |-
Expand Down Expand Up @@ -391,6 +393,15 @@ paths:
required: true
schema:
type: string
- schema:
type: boolean
default: 'false'
in: query
name: metadataEnabled
- schema:
type: string
in: query
name: pointInTime
requestBody:
content:
application/json:
Expand Down Expand Up @@ -4893,6 +4904,213 @@ paths:
Optionally, any metadata can be added
x-internal: false
'/containers/{container_id}/graphs/tags':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
post:
summary: Create Tag
operationId: post-containers-container_id-graphs-tags
responses:
'200':
description: OK
description: Create a Tag
requestBody:
content:
application/json:
schema:
type: object
properties:
tag_name:
type: string
container_id:
type: integer
examples:
example-1:
value: {}
'/containers/{container_id}/graphs/tags/{tag_id}/nodes/{node_id}':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: node_id
in: path
required: true
- schema:
type: string
name: tag_id
in: path
required: true
put:
summary: Tag Node
operationId: put-containers-container_id-graphs-tags-nodes-node_id
responses:
'200':
description: OK
description: Attach Tag to Node
'/containers/{container_id}/graphs/tags/{tag_id}/edges/{edge_id}':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: edge_id
in: path
required: true
- schema:
type: string
name: tag_id
in: path
required: true
put:
summary: Tag Edge
operationId: put-containers-container_id-graphs-tags-tag_id-edges-edge_id
responses:
'200':
description: OK
description: Tag an Edge
'/containers/{container_id}/graphs/tags/{tag_id}/files/{file_id}':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: file_id
in: path
required: true
- schema:
type: string
name: tag_id
in: path
required: true
put:
summary: Tag File
operationId: put-containers-container_id-graphs-tags-tag_id-files-file_id
responses:
'200':
description: OK
description: Tag a File
'/containers/{container_id}/graphs/tags/nodes/{node_id}':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: node_id
in: path
required: true
get:
summary: List Tags for Node
tags: []
responses: {}
operationId: get-containers-container_id-graphs-tags-nodes-node_id
description: List all Tags on a Node
'/containers/{container_id}/graphs/tags/files/{file_id}':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: file_id
in: path
required: true
get:
summary: List Tags for File
tags: []
responses: {}
operationId: get-containers-container_id-graphs-tags-files-file_id
description: List all Tags for a File
'/containers/{container_id}/graphs/tags/edges/{edge_id}':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: edge_id
in: path
required: true
get:
summary: List Tags for Edge
tags: []
responses: {}
operationId: get-containers-container_id-graphs-tags-edges-edge_id
description: List all Tags for an Edge
'/containers/{container_id}/graphs/tags/{tag_id}/nodes':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: tag_id
in: path
required: true
get:
summary: List Nodes with Tag
tags: []
responses: {}
operationId: get-containers-container_id-graphs-tags-nodes-tag_id
description: List all Nodes with a Tag
'/containers/{container_id}/graphs/tags/{tag_id}/files':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: tag_id
in: path
required: true
get:
summary: List Files with Tag
tags: []
responses: {}
operationId: get-containers-container_id-graphs-tags-tag_id-files
description: List all Files with Tag
'/containers/{container_id}/graphs/tags/{tag_id}/edges':
parameters:
- schema:
type: string
name: container_id
in: path
required: true
- schema:
type: string
name: tag_id
in: path
required: true
get:
summary: List Edges with Tag
tags: []
responses: {}
operationId: get-containers-container_id-graphs-tags-tag_id-edges
description: List all Edges with Tag
components:
securitySchemes:
BearerAuth:
Expand Down
2 changes: 1 addition & 1 deletion AdminWebApp/.env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VUE_APP_DEEP_LYNX_API_URL=http://localhost:8090
VUE_APP_DEEP_LYNX_API_AUTH_METHOD=token
VUE_APP_APP_URL=http://localhost:8080
VUE_APP_TIME_SERIES_ENABLED=false
VUE_APP_DATA_MANAGEMENT_ENABLED=false
VUE_APP_DATA_EDITOR_ENABLED=false

# application URL created through Deep Lynx's Applications page
VUE_APP_DEEP_LYNX_APP_ID=root
Expand Down
19 changes: 17 additions & 2 deletions AdminWebApp/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export type Config = {
password?: string;
};

export type GraphQLOptions = {
pointInTime?: string;
metadataEnabled?: boolean;
}

// We provide both a a constructor and a singleton type instance for consumption. The
// singleton applies sane defaults based on the configuration file. We know however
// that there might be instances in which you might want to maintain connections to two
Expand All @@ -60,13 +65,14 @@ export class Client {
return this.get<FullStatistics>(`/stats`);
}

submitGraphQLQuery(containerID: string, query: any, pointInTime?: string): Promise<any> {
submitGraphQLQuery(containerID: string, query: any, options?: GraphQLOptions): Promise<any> {
if (query.query) {
query.query = query.query.replace(/\n/g, '');
}

const queryParams: {[key: string]: any} = {};
if (pointInTime) queryParams.pointInTime = pointInTime;
if (options?.pointInTime) queryParams.pointInTime = options.pointInTime;
if (options?.metadataEnabled) queryParams.metadataEnabled = options.metadataEnabled;

return this.postRawReturn<any>(`/containers/${containerID}/data`, query, queryParams);
}
Expand Down Expand Up @@ -749,6 +755,7 @@ export class Client {
retrieveNodeHistory(containerID: string, nodeID: string): Promise<NodeT[]> {
const query: {[key: string]: any} = {};
query.history = 'true';
query.includeRawData = 'true';

return this.get<NodeT[]>(`/containers/${containerID}/graphs/nodes/${nodeID}`, query);
}
Expand All @@ -757,6 +764,14 @@ export class Client {
return this.get<EdgeT>(`/containers/${containerID}/graphs/edges/${edgeID}`);
}

retrieveEdgeHistory(containerID: string, edgeID: string): Promise<EdgeT[]> {
const query: {[key: string]: any} = {};
query.history = 'true';
query.includeRawData = 'true';

return this.get<EdgeT[]>(`/containers/${containerID}/graphs/edges/${edgeID}`, query);
}

countNodes(containerID: string, dataSourceID: string): Promise<number> {
const query: {[key: string]: any} = {};

Expand Down
Loading

0 comments on commit f93adb3

Please sign in to comment.