Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleted topology discovery rest APIcode #384

Merged
merged 3 commits into from
Dec 5, 2023
Merged
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
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ TOPOLOGY_ENABLED=true
# these fields are optional, they are used for topology functionality
# if TOPOLOGY_ENABLED=false they are ignored
# either define all of them or do not define them at all
TOPOLOGY_DISCOVERY_API_URL=http://10.19.0.5:8080/api/topology/data
TOPOLOGY_DISCOVERY_GRAPHQL_API_URL=http://localhost:5000/api/graphql
9 changes: 2 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function optionalEnvString(key: string): string | null {

type TopologyConfigEnabled = {
topologyEnabled: true;
topologyDiscoveryURL: string;
topologyDiscoveryGraphqlURL: string;
};

Expand All @@ -44,23 +43,19 @@ type TopologyConfig = TopologyConfigDisabled | TopologyConfigEnabled;
// all arango params must be present or none
function getTopologyConfig(): TopologyConfig {
const topologyEnabled = stringToBoolean(envString('TOPOLOGY_ENABLED'));
const topologyDiscoveryURL = optionalEnvString('TOPOLOGY_DISCOVERY_API_URL');
const topologyDiscoveryGraphqlURL = optionalEnvString('TOPOLOGY_DISCOVERY_GRAPHQL_API_URL');
if (!topologyEnabled) {
return {
topologyEnabled: false,
};
}

if (!topologyDiscoveryURL || !topologyDiscoveryGraphqlURL) {
throw new Error(
'Not all mandatory topology discovery url (TOPOLOGY_DISCOVERY_API_URL, TOPOLOGY_DISCOVERY_GRAPHQL_API_URL) were found.',
);
if (!topologyDiscoveryGraphqlURL) {
throw new Error('Not all mandatory topology discovery url (TOPOLOGY_DISCOVERY_GRAPHQL_API_URL) were found.');
}

return {
topologyEnabled: true,
topologyDiscoveryURL,
topologyDiscoveryGraphqlURL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/context.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { PrismaClient } from '@prisma/client';
import { ExpressContext } from 'apollo-server-express';
import topologyDiscoveryAPI, { TopologyDiscoveryAPI } from './external-api/topology-discovery';
import getTopologyDiscoveryApi, { TopologyDiscoveryGraphQLAPI } from './external-api/topology-discovery-graphql';
import conductorAPI, { ConductorAPI } from './external-api/conductor';
import uniconfigAPI, { UniConfigAPI } from './external-api/uniconfig';
Expand All @@ -12,7 +11,6 @@ export type Context = {
prisma: PrismaClient;
tenantId: string;
uniconfigAPI: UniConfigAPI;
topologyDiscoveryAPI: TopologyDiscoveryAPI;
topologyDiscoveryGraphQLAPI?: TopologyDiscoveryGraphQLAPI;
conductorAPI: ConductorAPI;
schedulerAPI: SchedulerAPI;
Expand All @@ -34,7 +32,6 @@ export default function createContext(context: ExpressContext): Context {
prisma: prismaClient,
tenantId,
uniconfigAPI,
topologyDiscoveryAPI,
topologyDiscoveryGraphQLAPI: getTopologyDiscoveryApi(),
conductorAPI,
schedulerAPI,
Expand Down
110 changes: 0 additions & 110 deletions src/external-api/topology-discovery.ts

This file was deleted.